include denom_pub into coin_ev_hash
This commit is contained in:
parent
be50c084f8
commit
2213012866
@ -266,6 +266,7 @@ verify_and_execute_recoup (
|
||||
NULL);
|
||||
}
|
||||
if (GNUNET_OK != TALER_coin_ev_hash (&blinded_planchet,
|
||||
&dk->denom_pub,
|
||||
&pc.h_blind))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
|
@ -503,6 +503,7 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
|
||||
wc.wsrd.h_denomination_pub
|
||||
= wc.collectable.denom_pub_hash;
|
||||
if (GNUNET_OK != TALER_coin_ev_hash (&wc.blinded_planchet,
|
||||
&dk->denom_pub,
|
||||
&wc.wsrd.h_coin_envelope))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
|
@ -1732,6 +1732,7 @@ run (void *cls)
|
||||
&c_hash,
|
||||
&pd.blinded_planchet));
|
||||
GNUNET_assert (GNUNET_OK == TALER_coin_ev_hash (&pd.blinded_planchet,
|
||||
&dkp->pub,
|
||||
&cbc.h_coin_envelope));
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_denom_sign_blinded (&cbc.sig,
|
||||
|
@ -1258,11 +1258,13 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info,
|
||||
* Compute the hash of a blinded coin.
|
||||
*
|
||||
* @param blinded_planchet blinded planchet
|
||||
* @param denom_pub denomination publick key
|
||||
* @param[out] bch where to write the hash
|
||||
* @return #GNUNET_OK when successful, #GNUNET_SYSERR if an internal error occured
|
||||
*/
|
||||
enum GNUNET_GenericReturnValue
|
||||
TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet,
|
||||
const struct TALER_DenominationPublicKey *denom_pub,
|
||||
struct TALER_BlindedCoinHash *bch);
|
||||
|
||||
|
||||
|
@ -438,6 +438,7 @@ TALER_EXCHANGE_withdraw2 (
|
||||
TALER_amount_hton (&req.amount_with_fee,
|
||||
&wh->requested_amount);
|
||||
if (GNUNET_OK != TALER_coin_ev_hash (&pd->blinded_planchet,
|
||||
&dk->key,
|
||||
&req.h_coin_envelope))
|
||||
{
|
||||
GNUNET_break (0);
|
||||
|
@ -502,22 +502,43 @@ TALER_refresh_get_commitment (struct TALER_RefreshCommitmentP *rc,
|
||||
|
||||
enum GNUNET_GenericReturnValue
|
||||
TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet,
|
||||
const struct TALER_DenominationPublicKey *denom_pub,
|
||||
struct TALER_BlindedCoinHash *bch)
|
||||
{
|
||||
switch (blinded_planchet->cipher)
|
||||
{
|
||||
case TALER_DENOMINATION_RSA:
|
||||
// FIXME: Include denom_pub into hash
|
||||
GNUNET_CRYPTO_hash (
|
||||
blinded_planchet->details.rsa_blinded_planchet.blinded_msg,
|
||||
blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size,
|
||||
&bch->hash);
|
||||
return GNUNET_OK;
|
||||
case TALER_DENOMINATION_CS:
|
||||
GNUNET_CRYPTO_hash (
|
||||
&blinded_planchet->details.cs_blinded_planchet.nonce,
|
||||
sizeof (blinded_planchet->details.cs_blinded_planchet.nonce),
|
||||
&bch->hash);
|
||||
return GNUNET_OK;
|
||||
{
|
||||
char delim = ':';
|
||||
size_t buf_len = sizeof(denom_pub->details.cs_public_key)
|
||||
+ sizeof (blinded_planchet->details.cs_blinded_planchet.
|
||||
nonce)
|
||||
+ sizeof(delim);
|
||||
void*buf = GNUNET_malloc (buf_len);
|
||||
memcpy (buf,
|
||||
&denom_pub->details.cs_public_key,
|
||||
sizeof(denom_pub->details.cs_public_key));
|
||||
memcpy (buf + sizeof(denom_pub->details.cs_public_key),
|
||||
&delim,
|
||||
sizeof(delim));
|
||||
memcpy (buf + sizeof(denom_pub->details.cs_public_key) + sizeof(delim),
|
||||
&blinded_planchet->details.cs_blinded_planchet.nonce,
|
||||
sizeof (blinded_planchet->details.cs_blinded_planchet.nonce));
|
||||
GNUNET_CRYPTO_hash (
|
||||
buf,
|
||||
buf_len,
|
||||
&bch->hash);
|
||||
GNUNET_free (buf);
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
||||
default:
|
||||
GNUNET_break (0);
|
||||
return GNUNET_SYSERR;
|
||||
|
@ -198,33 +198,11 @@ TALER_denom_sig_unblind (
|
||||
case TALER_DENOMINATION_CS:
|
||||
{
|
||||
struct GNUNET_CRYPTO_CsBlindingSecret bs[2];
|
||||
// struct TALER_DenominationCsPublicR r_pub_blind;
|
||||
// struct GNUNET_CRYPTO_CsC c[2];
|
||||
// struct TALER_CoinPubHash c_hash;
|
||||
|
||||
// TALER_coin_pub_hash (coin_pub,
|
||||
// age_commitment_hash,
|
||||
// c_hash);
|
||||
|
||||
GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce, bs);
|
||||
|
||||
// GNUNET_CRYPTO_cs_calc_blinded_c (bs,
|
||||
// &alg_values->r_pub,
|
||||
// &denom_pub->details.cs_public_key,
|
||||
// &c_hash->hash,
|
||||
// sizeof(struct GNUNET_HashCode),
|
||||
// c,
|
||||
// r_pub_blind->r_pub);
|
||||
|
||||
GNUNET_CRYPTO_cs_unblind (&bdenom_sig->details.blinded_cs_answer.s_scalar,
|
||||
&bs[bdenom_sig->details.blinded_cs_answer.b],
|
||||
&denom_sig->details.cs_signature.s_scalar);
|
||||
|
||||
// GNUNET_memcpy (&denom_sig->details.cs_signature.r_point,
|
||||
// &r_pub_blind.r_pub[bdenom_sig->details.blinded_cs_answer.b
|
||||
// ],
|
||||
// sizeof(struct GNUNET_CRYPTO_CsRPublic));
|
||||
|
||||
denom_sig->cipher = TALER_DENOMINATION_CS;
|
||||
return GNUNET_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user