test TALER_denom_blind/TALER_denom_sign_blinded with and without TALER_AgeHash
This commit is contained in:
parent
93415b6a35
commit
dbd18a36d5
@ -1469,27 +1469,36 @@ run (void *cls)
|
||||
{
|
||||
struct TALER_PlanchetDetail pd;
|
||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||
struct TALER_AgeHash age_hash;
|
||||
struct TALER_AgeHash *p_ah[2] = {NULL, &age_hash};
|
||||
|
||||
RND_BLK (&coin_pub);
|
||||
TALER_blinding_secret_create (&bks);
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_denom_blind (&dkp->pub,
|
||||
&bks,
|
||||
NULL, /* FIXME-Oec */
|
||||
&coin_pub,
|
||||
&c_hash,
|
||||
&pd.coin_ev,
|
||||
&pd.coin_ev_size));
|
||||
TALER_coin_ev_hash (pd.coin_ev,
|
||||
pd.coin_ev_size,
|
||||
&cbc.h_coin_envelope);
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_denom_sign_blinded (&cbc.sig,
|
||||
&dkp->priv,
|
||||
pd.coin_ev,
|
||||
pd.coin_ev_size));
|
||||
GNUNET_free (pd.coin_ev);
|
||||
/* Call TALER_denom_blind()/TALER_denom_sign_blinded() twice, once without
|
||||
* age_hash, once with age_hash */
|
||||
RND_BLK (&age_hash);
|
||||
for (size_t i = 0; i < sizeof(p_ah) / sizeof(p_ah[0]); i++)
|
||||
{
|
||||
RND_BLK (&coin_pub);
|
||||
TALER_blinding_secret_create (&bks);
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_denom_blind (&dkp->pub,
|
||||
&bks,
|
||||
p_ah[i],
|
||||
&coin_pub,
|
||||
&c_hash,
|
||||
&pd.coin_ev,
|
||||
&pd.coin_ev_size));
|
||||
TALER_coin_ev_hash (pd.coin_ev,
|
||||
pd.coin_ev_size,
|
||||
&cbc.h_coin_envelope);
|
||||
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.amount_with_fee = value;
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
|
Loading…
Reference in New Issue
Block a user