diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto.c | 5 | ||||
-rw-r--r-- | src/util/denom.c | 32 |
2 files changed, 34 insertions, 3 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c index c239f7970..8e48b48d1 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -519,9 +519,8 @@ TALER_refresh_get_commitment (struct TALER_RefreshCommitmentP *rc, { const struct TALER_RefreshCoinData *rcd = &rce->new_coins[j]; - GNUNET_CRYPTO_hash_context_read (hash_context, - rcd->coin_ev, - rcd->coin_ev_size); + TALER_blinded_planchet_hash (&rcd->blinded_planchet, + hash_context); } } diff --git a/src/util/denom.c b/src/util/denom.c index caaa4f4e8..0c1f99225 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -691,4 +691,36 @@ TALER_blinded_denom_sig_cmp ( } +void +TALER_blinded_planchet_hash (const struct TALER_BlindedPlanchet *bp, + struct GNUNET_HashContext *hash_context) +{ + uint32_t cipher = htonl (bp->cipher); + + GNUNET_CRYPTO_hash_context_read (hash_context, + &cipher, + sizeof (cipher)); + switch (bp->cipher) + { + case TALER_DENOMINATION_INVALID: + break; + case TALER_DENOMINATION_RSA: + GNUNET_CRYPTO_hash_context_read ( + hash_context, + bp->details.rsa_blinded_planchet.blinded_msg, + bp->details.rsa_blinded_planchet.blinded_msg_size); + break; + case TALER_DENOMINATION_CS: + GNUNET_CRYPTO_hash_context_read ( + hash_context, + &bp->details.cs_blinded_planchet, + sizeof (bp->details.cs_blinded_planchet)); + break; + default: + GNUNET_assert (0); + break; + } +} + + /* end of denom.c */ |