aboutsummaryrefslogtreecommitdiff
path: root/src/util/denom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/denom.c')
-rw-r--r--src/util/denom.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/util/denom.c b/src/util/denom.c
index caaa4f4e..0c1f9922 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 */