exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 002b4bf117c73ad6fca1731e23b6816a0d2800c2
parent 0ab917d46cd3b4e73f3fe79e8b4a97236fc90ee5
Author: Christian Blättler <blatc2@bfh.ch>
Date:   Thu, 25 Apr 2024 16:27:10 +0200

add token issue signature methods

Diffstat:
Msrc/include/taler_crypto_lib.h | 38+++++++++++++++++++++++++++++++++++---
Msrc/util/tokens.c | 2+-
2 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h @@ -2302,7 +2302,7 @@ struct TALER_TokenIssueBlindSignatureP /** * The public key of a token. An EdDSA public key generated by the wallet - * and blindly signed by the merchant using the @struct TALER_TokenIssuePrivateKey. + * and blindly signed by the merchant using the @struct TALER_TokenIssuePrivateKeyP. */ struct TALER_TokenUsePublicKeyP { @@ -2328,6 +2328,17 @@ struct TALER_TokenUseSignatureP struct GNUNET_CRYPTO_EddsaSignature signature; }; +/** + * The blinded token use public key of a token. Ready to be signed by the merchant. + */ +struct TALER_TokenEnvelopeP +{ + /** + * Blinded public key of the token. + */ + struct GNUNET_CRYPTO_BlindedMessage blinded_pub; +}; + /** * Free internals of @a issue_sig, but not @a issue_sig itself. @@ -3913,12 +3924,33 @@ TALER_merchant_refund_verify ( const struct TALER_MerchantSignatureP *merchant_sig); +/** + * Issue a new token by signing a token envelope, that contains the + * blinded public key provided by the wallet. + * + * @param envelope the token envelope to sign + * @param issue_priv token issue private key to sign with + * @param[out] blind_sig where to write the blinded issue signature + */ void -TALER_merchant_token_issue_sign (); +TALER_merchant_token_issue_sign ( + const struct TALER_TokenEnvelopeP *envelope, + const struct TALER_TokenIssuePrivateKeyP *issue_priv, + struct TALER_TokenIssueBlindSignatureP *blind_sig); +/** + * Verify a token issue signature. + * + * @param use_pub token use public key + * @param issue_pub token issue public key + * @param ub_sig unblinded signature + */ enum GNUNET_GenericReturnValue -TALER_merchant_token_issue_verify (); +TALER_merchant_token_issue_verify ( + const struct TALER_TokenUsePublicKeyP *use_pub, + const struct TALER_TokenIssuePublicKeyP *issue_pub, + const struct TALER_TokenIssueSignatureP *ub_sig); /* ********************* exchange deposit signing ************************* */ diff --git a/src/util/tokens.c b/src/util/tokens.c @@ -23,7 +23,7 @@ void -TALER_token_issue_sig_free (struct TALER_TokenIssueSignature *issue_sig) +TALER_token_issue_sig_free (struct TALER_TokenIssueSignatureP *issue_sig) { if (NULL != issue_sig->signature) {