diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-21 16:16:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-25 13:56:40 +0100 |
commit | 2c14d338704f4574055c4b5c51d8a79dd2e22345 (patch) | |
tree | b90afcabc65e7f27b531098a8bf3ce48a5362593 /src/include | |
parent | 1b23857f2cb56f4aa95a07d7c52bd48abc20b73b (diff) |
deduplicate melt signing logic, remove coin_pub from data being signed over
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 41 | ||||
-rw-r--r-- | src/include/taler_signatures.h | 7 |
2 files changed, 41 insertions, 7 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 5895d1210..89e8697d6 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -1724,6 +1724,47 @@ TALER_wallet_deposit_verify ( /** + * Sign a melt request. + * + * @param amount the amount to be melted (with fee) + * @param melt_fee the melt fee we expect to pay + * @param rc refresh session we are committed to + * @param h_denom_pub hash of the coin denomination's public key + * @param coin_priv coin’s private key + * @param[out] coin_sig set to the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_MELT + */ +void +TALER_wallet_melt_sign ( + const struct TALER_Amount *amount_with_fee, + const struct TALER_Amount *melt_fee, + const struct TALER_RefreshCommitmentP *rc, + const struct TALER_DenominationHash *h_denom_pub, + const struct TALER_CoinSpendPrivateKeyP *coin_priv, + struct TALER_CoinSpendSignatureP *coin_sig); + + +/** + * Verify a melt request. + * + * @param amount the amount to be melted (with fee) + * @param melt_fee the melt fee we expect to pay + * @param rc refresh session we are committed to + * @param h_denom_pub hash of the coin denomination's public key + * @param coin_pub coin’s public key + * @param coin_sig the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_MELT + * @return #GNUNET_OK if the signature is valid + */ +enum GNUNET_GenericReturnValue +TALER_wallet_melt_verify ( + const struct TALER_Amount *amount_with_fee, + const struct TALER_Amount *melt_fee, + const struct TALER_RefreshCommitmentP *rc, + const struct TALER_DenominationHash *h_denom_pub, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_CoinSpendSignatureP *coin_sig); + + +/** * Sign link data. * * @param h_denom_pub hash of the denomiantion public key of the new coin diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 643aa80de..d3a3d02fc 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -728,13 +728,6 @@ struct TALER_RefreshMeltCoinAffirmationPS * session. */ struct TALER_AmountNBO melt_fee; - - /** - * The coin's public key. This is the value that must have been - * signed (blindly) by the Exchange. The deposit request is to be - * signed by the corresponding private key (using EdDSA). - */ - struct TALER_CoinSpendPublicKeyP coin_pub; }; |