diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto.c | 22 | ||||
-rw-r--r-- | src/util/denom.c | 32 |
2 files changed, 39 insertions, 15 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c index 7d4a431c..ed32f31d 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -185,21 +185,13 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk, GNUNET_CRYPTO_eddsa_key_get_public (&ps->coin_priv.eddsa_priv, &coin_pub.eddsa_pub); - // FIXME-Oec: replace with function that - // also hashes the age vector if we have - // one! - TALER_coin_pub_hash (&coin_pub, - c_hash); - // FIXME-Gian/Lucien: this will be the bigger - // change, as you have the extra round trip - // => to be discussed! - GNUNET_assert (TALER_DENOMINATION_RSA == dk->cipher); - if (GNUNET_YES != - TALER_rsa_blind (c_hash, - &ps->blinding_key.rsa_bks, - dk->details.rsa_public_key, - &pd->coin_ev, - &pd->coin_ev_size)) + if (GNUNET_OK != + TALER_denom_blind (dk, + &ps->blinding_key, + &coin_pub, + c_hash, + &pd->coin_ev, + &pd->coin_ev_size)) { GNUNET_break_op (0); return GNUNET_SYSERR; diff --git a/src/util/denom.c b/src/util/denom.c index 4a47c66d..4f1fc8e5 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) |