diff options
Diffstat (limited to 'src/mint/mint.h')
-rw-r--r-- | src/mint/mint.h | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/src/mint/mint.h b/src/mint/mint.h index 046b9c17..05e966e1 100644 --- a/src/mint/mint.h +++ b/src/mint/mint.h @@ -28,6 +28,7 @@ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_common.h> #include <libpq-fe.h> +#include <jansson.h> #include "taler_util.h" #include "taler_signatures.h" @@ -71,13 +72,15 @@ struct TALER_CoinPublicInfo */ struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; - /* - * The public key signifying the coin's denomination. + /** + * Public key representing the denomination of the coin + * that is being deposited. */ struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub; /** - * Signature over coin_pub by denom_pub. + * (Unblinded) signature over @e coin_pub with @e denom_pub, + * which demonstrates that the coin is valid. */ struct GNUNET_CRYPTO_rsa_Signature *denom_sig; }; @@ -236,33 +239,62 @@ struct KnownCoin */ struct Deposit { - /* FIXME: should be TALER_CoinPublicInfo */ - struct GNUNET_CRYPTO_EddsaPublicKey coin_pub; + /** + * Information about the coin that is being deposited. + */ + struct TALER_CoinPublicInfo coin; - struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub; + /** + * EdDSA signature affirming that the customer intends + * this coin to be deposited at the merchant identified + * by @e h_wire in relation to the contract identified + * by @e h_contract. + */ + struct GNUNET_CRYPTO_EddsaSignature csig; - struct GNUNET_CRYPTO_rsa_Signature *coin_sig; + /** + * Public key of the merchant. Enables later identification + * of the merchant in case of a need to rollback transactions. + */ + struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub; - struct GNUNET_CRYPTO_rsa_Signature *ubsig; // ??? + /** + * Hash over the contract between merchant and customer + * (remains unknown to the Mint). + */ + struct GNUNET_HashCode h_contract; /** - * Type of the deposit (also purpose of the signature). Either - * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT. + * Hash of the (canonical) representation of @e wire, used + * to check the signature on the request. Generated by + * the mint from the detailed wire data provided by the + * merchant. */ - // struct TALER_RSA_SignaturePurpose purpose; // FIXME: bad type! + struct GNUNET_HashCode h_wire; + /** + * Detailed wire information for executing the transaction. + */ + const json_t *wire; + + /** + * Merchant-generated transaction ID to detect duplicate + * transactions. + */ uint64_t transaction_id; + /** + * Fraction of the coin's remaining value to be deposited. + * The coin is identified by @e coin_pub. + */ struct TALER_AmountNBO amount; - struct GNUNET_CRYPTO_EddsaPublicKey merchant_pub; - - struct GNUNET_HashCode h_contract; - - struct GNUNET_HashCode h_wire; + /** + * Type of the deposit (also purpose of the signature). Either + * #TALER_SIGNATURE_DEPOSIT or #TALER_SIGNATURE_INCREMENTAL_DEPOSIT. + */ + uint32_t purpose; // FIXME: bad type, use ENUM! - /* TODO: uint16_t wire_size */ - char wire[]; /* string encoded wire JSON object */ }; |