From ba627bf84c89ea93a117bce8563b30a3d460e633 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 5 Nov 2021 22:22:47 +0100 Subject: -fixes --- src/util/denom.c | 61 ++++++++++---------------------------------------------- 1 file changed, 10 insertions(+), 51 deletions(-) (limited to 'src/util/denom.c') diff --git a/src/util/denom.c b/src/util/denom.c index 9261779ea..a1f511fe6 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -110,17 +110,12 @@ TALER_denom_sign_blinded (struct TALER_BlindedDenominationSignature *denom_sig, 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) +TALER_denom_sig_unblind ( + struct TALER_DenominationSignature *denom_sig, + const struct TALER_BlindedDenominationSignature *bdenom_sig, + const union TALER_DenominationBlindingKeyP *bks, + const struct TALER_DenominationPublicKey *denom_pub) { - if (bks->cipher != denom_pub->cipher) - { - GNUNET_break (0); - return GNUNET_SYSERR; - } if (bdenom_sig->cipher != denom_pub->cipher) { GNUNET_break (0); @@ -135,7 +130,7 @@ TALER_denom_sig_unblind (struct TALER_DenominationSignature *denom_sig, denom_sig->details.rsa_signature = TALER_rsa_unblind ( bdenom_sig->details.blinded_rsa_signature, - &bks->details.rsa_bks, + &bks->rsa_bks, denom_pub->details.rsa_public_key); if (NULL == denom_sig->details.rsa_signature) { @@ -152,48 +147,12 @@ TALER_denom_sig_unblind (struct TALER_DenominationSignature *denom_sig, } -enum GNUNET_GenericReturnValue -TALER_blinding_secret_create (struct TALER_BlindingSecret *bs, - enum TALER_DenominationCipher cipher, - ...) -{ - memset (bs, - 0, - sizeof (*bs)); - switch (cipher) - { - case TALER_DENOMINATION_INVALID: - return GNUNET_OK; - case TALER_DENOMINATION_RSA: - bs->cipher = TALER_DENOMINATION_RSA; - GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, - &bs->details.rsa_bks, - sizeof (bs->details.rsa_bks)); - return GNUNET_OK; - // TODO: add case for Clause-Schnorr - default: - GNUNET_break (0); - } - return GNUNET_SYSERR; -} - - void -TALER_blinding_secret_free (struct TALER_BlindingSecret *bs) +TALER_blinding_secret_create (union TALER_DenominationBlindingKeyP *bs) { - switch (bs->cipher) - { - case TALER_DENOMINATION_INVALID: - return; - case TALER_DENOMINATION_RSA: - memset (bs, - 0, - sizeof (*bs)); - return; - // TODO: add case for Clause-Schnorr - default: - GNUNET_break (0); - } + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, + bs, + sizeof (*bs)); } -- cgit v1.2.3