diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2021-11-05 14:18:13 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2021-11-05 14:18:13 +0100 |
commit | c787e28e842a8ec538041df68d7d195cc7be9485 (patch) | |
tree | da0a00fa5e4c9a3f5fa981bd5d08a3da0ecbab09 /src/include | |
parent | 32da809fd665f1ac19210bf48952f1988f417fb8 (diff) |
more denom key refactoring
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index b726972ce..06247689f 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -588,6 +588,29 @@ struct TALER_DenominationPublicKey /** + * Client-side secrets for blinding. + */ +struct TALER_BlindingSecret +{ + + /** + * Type of the blinding secret. + */ + enum TALER_DenominationCipher cipher; + + union + { + + /** + * Blinding key secret for RSA. + */ + struct GNUNET_CRYPTO_RsaBlindingKeySecret rsa_bks; + + } details; +}; + + +/** * @brief Type of private signing keys for blind signing of coins. */ struct TALER_DenominationPrivateKey @@ -678,6 +701,27 @@ TALER_denom_pub_free (struct TALER_DenominationPublicKey *denom_pub); /** + * Create a blinding secret @a bs for @a cipher. + * + * @param[out] blinding secret to initialize + * @param cipher cipher to create blinding secret for + */ +enum GNUNET_GenericReturnValue +TALER_blinding_secret_create (struct TALER_BlindingSecret *bs, + enum TALER_DenominationCipher cipher, + ...); + + +/** + * Release memory inside of a blinding secret @a bs. + * + * @param[in] blinding secret to free + */ +void +TALER_blinding_secret_free (struct TALER_BlindingSecret *bs); + + +/** * Initialize denomination public-private key pair. * * For #TALER_DENOMINATION_RSA, an additional "unsigned int" @@ -732,6 +776,23 @@ TALER_denom_sign_blinded (struct TALER_BlindedDenominationSignature *denom_sig, /** + * Unblind blinded signature. + * + * @param[out] denom_sig where to write the unblinded signature + * @param bdenom_sig the blinded signature + * @param bks blinding secret to use + * @param denom_pub public key used for signing + * @return #GNUNET_OK on success + */ +enum GNUNET_GenericReturnValue +TALER_denom_sig_unblind (struct TALER_DenominationSignature *denom_sig, + const struct + TALER_BlindedDenominationSignature *bdenom_sig, + const struct TALER_BlindingSecret *bks, + const struct TALER_DenominationPublicKey *denom_pub); + + +/** * Free internals of @a denom_sig, but not @a denom_sig itself. * * @param[in] denom_sig signature to free |