summaryrefslogtreecommitdiff
path: root/src/util/test_crypto.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-04-22 15:14:30 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2022-04-22 15:15:57 +0200
commit31c545b9e803310312a0d9433e79cf206e00ffe4 (patch)
treebed76f9858625a1d9f3e88d18e0b11d5ac70a7e7 /src/util/test_crypto.c
parenteea35ffb01328f4109e4cfaeeff1c3cae586d8e4 (diff)
downloadexchange-31c545b9e803310312a0d9433e79cf206e00ffe4.tar.gz
exchange-31c545b9e803310312a0d9433e79cf206e00ffe4.tar.bz2
exchange-31c545b9e803310312a0d9433e79cf206e00ffe4.zip
-fixed tests for age restriction, now using correct seed
Diffstat (limited to 'src/util/test_crypto.c')
-rw-r--r--src/util/test_crypto.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index c9f690b2b..a517b5bc3 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -131,13 +131,16 @@ test_planchets_rsa (uint8_t age)
{
struct TALER_AgeCommitmentProof acp;
struct TALER_AgeCommitmentHash ah = {0};
- uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
- UINT64_MAX);
+ struct GNUNET_HashCode seed;
+
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &seed,
+ sizeof(seed));
GNUNET_assert (GNUNET_OK ==
TALER_age_restriction_commit (&age_mask,
age,
- salt,
+ &seed,
&acp));
TALER_age_commitment_hash (&acp.commitment,
&ah);
@@ -260,13 +263,16 @@ test_planchets_cs (uint8_t age)
{
struct TALER_AgeCommitmentHash ah = {0};
struct TALER_AgeCommitmentProof acp;
- uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
- UINT64_MAX);
+ struct GNUNET_HashCode seed;
+
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &seed,
+ sizeof(seed));
GNUNET_assert (GNUNET_OK ==
TALER_age_restriction_commit (&age_mask,
age,
- salt,
+ &seed,
&acp));
TALER_age_commitment_hash (&acp.commitment,
&ah);