diff options
Diffstat (limited to 'src/mint/mint_db.h')
-rw-r--r-- | src/mint/mint_db.h | 143 |
1 files changed, 1 insertions, 142 deletions
diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h index 5fab7c02..d5a74a45 100644 --- a/src/mint/mint_db.h +++ b/src/mint/mint_db.h @@ -29,149 +29,8 @@ #include "taler_util.h" #include "taler_rsa.h" #include "taler-mint-httpd_db.h" +#include "mint.h" -/** - * Public information about a coin. - */ -struct TALER_CoinPublicInfo -{ - /** - * The coin's public key. - */ - struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; - - /* - * The public key signifying the coin's denomination. - */ - struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; - - /** - * Signature over coin_pub by denom_pub. - */ - struct TALER_RSA_Signature denom_sig; -}; - - - - - - -/** - * Reserve row. Corresponds to table 'reserves' in - * the mint's database. - */ -struct Reserve -{ - /** - * Signature over the purse. - * Only valid if (blind_session_missing==GNUNET_YES). - */ - struct GNUNET_CRYPTO_EddsaSignature status_sig; - /** - * Signature with purpose TALER_SIGNATURE_PURSE. - * Only valid if (blind_session_missing==GNUNET_YES). - */ - struct GNUNET_CRYPTO_EccSignaturePurpose status_sig_purpose; - /** - * Signing key used to sign the purse. - * Only valid if (blind_session_missing==GNUNET_YES). - */ - struct GNUNET_CRYPTO_EddsaPublicKey status_sign_pub; - /** - * Withdraw public key, identifies the purse. - * Only the customer knows the corresponding private key. - */ - struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub; - /** - * Remaining balance in the purse. - */ - struct TALER_AmountNBO balance; - - /** - * Expiration date for the purse. - */ - struct GNUNET_TIME_AbsoluteNBO expiration; -}; - - -struct CollectableBlindcoin -{ - struct TALER_RSA_BlindedSignaturePurpose ev; - struct TALER_RSA_Signature ev_sig; - struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; - struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub; - struct GNUNET_CRYPTO_EddsaSignature reserve_sig; -}; - - -struct RefreshSession -{ - int has_commit_sig; - struct GNUNET_CRYPTO_EddsaSignature commit_sig; - struct GNUNET_CRYPTO_EddsaPublicKey session_pub; - uint16_t num_oldcoins; - uint16_t num_newcoins; - uint16_t kappa; - uint16_t noreveal_index; - uint8_t reveal_ok; -}; - - -#define TALER_REFRESH_SHARED_SECRET_LENGTH (sizeof (struct GNUNET_HashCode)) -#define TALER_REFRESH_LINK_LENGTH (sizeof (struct LinkData)) - -struct RefreshCommitLink -{ - struct GNUNET_CRYPTO_EddsaPublicKey session_pub; - struct GNUNET_CRYPTO_EcdsaPublicKey transfer_pub; - uint16_t cnc_index; - uint16_t oldcoin_index; - char shared_secret_enc[sizeof (struct GNUNET_HashCode)]; -}; - -struct LinkData -{ - struct GNUNET_CRYPTO_EcdsaPrivateKey coin_priv; - struct TALER_RSA_BlindingKeyBinaryEncoded bkey_enc; -}; - - -GNUNET_NETWORK_STRUCT_BEGIN - -struct SharedSecretEnc -{ - char data[TALER_REFRESH_SHARED_SECRET_LENGTH]; -}; - - -struct LinkDataEnc -{ - char data[sizeof (struct LinkData)]; -}; - -GNUNET_NETWORK_STRUCT_END - -struct RefreshCommitCoin -{ - struct GNUNET_CRYPTO_EddsaPublicKey session_pub; - struct TALER_RSA_BlindedSignaturePurpose coin_ev; - uint16_t cnc_index; - uint16_t newcoin_index; - char link_enc[sizeof (struct LinkData)]; -}; - - -struct KnownCoin -{ - struct TALER_CoinPublicInfo public_info; - struct TALER_Amount expended_balance; - int is_refreshed; - /** - * Refreshing session, only valid if - * is_refreshed==1. - */ - struct GNUNET_CRYPTO_EddsaPublicKey refresh_session_pub; -}; int TALER_MINT_DB_prepare (PGconn *db_conn); |