diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-05 23:01:21 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-05 23:01:21 +0100 |
commit | c3e244322b6b7234c0234471b07d67bf6a210b91 (patch) | |
tree | 6b5b73eddac8662bacb74406c24a3277a0252048 /src/util/denom.c | |
parent | eaf9d728f54681be4e9ed3467ff9d10e71ad2b04 (diff) | |
download | exchange-c3e244322b6b7234c0234471b07d67bf6a210b91.tar.xz |
more crypto refactoring
Diffstat (limited to 'src/util/denom.c')
-rw-r--r-- | src/util/denom.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/util/denom.c b/src/util/denom.c index 4a47c66d4..4f1fc8e59 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -217,6 +217,38 @@ TALER_denom_priv_to_pub (const struct TALER_DenominationPrivateKey *denom_priv, enum GNUNET_GenericReturnValue +TALER_denom_blind (const struct TALER_DenominationPublicKey *dk, + const union TALER_DenominationBlindingKeyP *coin_bks, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + struct TALER_CoinPubHash *c_hash, + void **coin_ev, + size_t *coin_ev_size) +{ + switch (dk->cipher) + { + case TALER_DENOMINATION_RSA: + TALER_coin_pub_hash (coin_pub, + c_hash); + if (GNUNET_YES != + TALER_rsa_blind (c_hash, + &coin_bks->rsa_bks, + dk->details.rsa_public_key, + coin_ev, + coin_ev_size)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + return GNUNET_OK; + // TODO: add case for Clause-Schnorr + default: + GNUNET_break (0); + return GNUNET_SYSERR; + } +} + + +enum GNUNET_GenericReturnValue TALER_denom_pub_verify (const struct TALER_DenominationPublicKey *denom_pub, const struct TALER_DenominationSignature *denom_sig, const struct TALER_CoinPubHash *c_hash) |