test TALER_denom_blind/TALER_denom_sign_blinded with and without TALER_AgeHash

This commit is contained in:
Özgür Kesim 2022-01-12 12:43:56 +01:00
parent 93415b6a35
commit dbd18a36d5
Signed by: oec
GPG Key ID: 3D76A56D79EDD9D7

View File

@ -1469,27 +1469,36 @@ run (void *cls)
{ {
struct TALER_PlanchetDetail pd; struct TALER_PlanchetDetail pd;
struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_CoinSpendPublicKeyP coin_pub;
struct TALER_AgeHash age_hash;
struct TALER_AgeHash *p_ah[2] = {NULL, &age_hash};
RND_BLK (&coin_pub); /* Call TALER_denom_blind()/TALER_denom_sign_blinded() twice, once without
TALER_blinding_secret_create (&bks); * age_hash, once with age_hash */
GNUNET_assert (GNUNET_OK == RND_BLK (&age_hash);
TALER_denom_blind (&dkp->pub, for (size_t i = 0; i < sizeof(p_ah) / sizeof(p_ah[0]); i++)
&bks, {
NULL, /* FIXME-Oec */ RND_BLK (&coin_pub);
&coin_pub, TALER_blinding_secret_create (&bks);
&c_hash, GNUNET_assert (GNUNET_OK ==
&pd.coin_ev, TALER_denom_blind (&dkp->pub,
&pd.coin_ev_size)); &bks,
TALER_coin_ev_hash (pd.coin_ev, p_ah[i],
pd.coin_ev_size, &coin_pub,
&cbc.h_coin_envelope); &c_hash,
GNUNET_assert (GNUNET_OK == &pd.coin_ev,
TALER_denom_sign_blinded (&cbc.sig, &pd.coin_ev_size));
&dkp->priv, TALER_coin_ev_hash (pd.coin_ev,
pd.coin_ev, pd.coin_ev_size,
pd.coin_ev_size)); &cbc.h_coin_envelope);
GNUNET_free (pd.coin_ev); GNUNET_assert (GNUNET_OK ==
TALER_denom_sign_blinded (&cbc.sig,
&dkp->priv,
pd.coin_ev,
pd.coin_ev_size));
GNUNET_free (pd.coin_ev);
}
} }
cbc.reserve_pub = reserve_pub; cbc.reserve_pub = reserve_pub;
cbc.amount_with_fee = value; cbc.amount_with_fee = value;
GNUNET_assert (GNUNET_OK == GNUNET_assert (GNUNET_OK ==