aboutsummaryrefslogtreecommitdiff
path: root/src/util/age_restriction.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/age_restriction.c
parenteea35ffb01328f4109e4cfaeeff1c3cae586d8e4 (diff)
-fixed tests for age restriction, now using correct seed
Diffstat (limited to 'src/util/age_restriction.c')
-rw-r--r--src/util/age_restriction.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/age_restriction.c b/src/util/age_restriction.c
index 1fa8c558a..dfb376b2d 100644
--- a/src/util/age_restriction.c
+++ b/src/util/age_restriction.c
@@ -88,17 +88,19 @@ TALER_age_restriction_commit (
const struct GNUNET_HashCode *seed,
struct TALER_AgeCommitmentProof *new)
{
- struct GNUNET_HashCode seed_i = *seed;
+ struct GNUNET_HashCode seed_i;
uint8_t num_pub = __builtin_popcount (mask->bits) - 1;
uint8_t num_priv = get_age_group (mask, age);
size_t i;
+ GNUNET_assert (NULL != seed);
GNUNET_assert (NULL != new);
GNUNET_assert (mask->bits & 1); /* fist bit must have been set */
GNUNET_assert (0 <= num_priv);
GNUNET_assert (31 > num_priv);
GNUNET_assert (num_priv <= num_pub);
+ seed_i = *seed;
new->commitment.mask.bits = mask->bits;
new->commitment.num = num_pub;
new->proof.num = num_priv;