From 32da809fd665f1ac19210bf48952f1988f417fb8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 5 Nov 2021 14:00:10 +0100 Subject: abstract denomination keys a bit more --- src/include/taler_crypto_lib.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 8871369e2..b726972ce 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -677,6 +677,26 @@ void TALER_denom_pub_free (struct TALER_DenominationPublicKey *denom_pub); +/** + * Initialize denomination public-private key pair. + * + * For #TALER_DENOMINATION_RSA, an additional "unsigned int" + * argument with the number of bits for 'n' (e.g. 2048) must + * be passed. + * + * @param[out] denom_priv where to write the private key + * @param[out] deonm_pub where to write the public key + * @param cipher which type of cipher to use + * @param ... cipher-specific parameters + * @return #GNUNET_OK on success, #GNUNET_NO if parameters were invalid + */ +enum GNUNET_GenericReturnValue +TALER_denom_priv_create (struct TALER_DenominationPrivateKey *denom_priv, + struct TALER_DenominationPublicKey *denom_pub, + enum TALER_DenominationCipher cipher, + ...); + + /** * Free internals of @a denom_priv, but not @a denom_priv itself. * @@ -695,6 +715,22 @@ void TALER_denom_sig_free (struct TALER_DenominationSignature *denom_sig); +/** + * Create blinded signature. + * + * @param[out] denom_sig where to write the signature + * @param denom_priv private key to use for signing + * @param blinded_msg message to sign + * @param blinded_msg_size number of bytes in @a blinded_msg + * @return #GNUNET_OK on success + */ +enum GNUNET_GenericReturnValue +TALER_denom_sign_blinded (struct TALER_BlindedDenominationSignature *denom_sig, + const struct TALER_DenominationPrivateKey *denom_priv, + void *blinded_msg, + size_t blinded_msg_size); + + /** * Free internals of @a denom_sig, but not @a denom_sig itself. * -- cgit v1.2.3