From b84c88fc0421abb12c83892af3fa9934c4e33b24 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Thu, 21 Apr 2022 14:27:29 +0200 Subject: Fixed seed size for TALER_age_restriction_commit Also, added src/util/tv_age_restriction.{c,json} for/as test vectors for age restriction. --- src/testing/testing_api_cmd_withdraw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/testing/testing_api_cmd_withdraw.c') diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index 80f8402c..de862f91 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -578,19 +578,21 @@ TALER_TESTING_cmd_withdraw_amount (const char *label, { struct TALER_AgeCommitmentProof *acp; struct TALER_AgeCommitmentHash *hac; - uint32_t seed; + struct GNUNET_HashCode seed; struct TALER_AgeMask mask; acp = GNUNET_new (struct TALER_AgeCommitmentProof); hac = GNUNET_new (struct TALER_AgeCommitmentHash); - seed = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX); mask = TALER_extensions_age_restriction_ageMask (); + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, + &seed, + sizeof(seed)); if (GNUNET_OK != TALER_age_restriction_commit ( &mask, age, - seed, + &seed, acp)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, -- cgit v1.2.3