From fb9ba5b1d2970e24643d179338b34c8915d2072d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 7 Feb 2022 12:33:35 +0100 Subject: -rename fest --- src/util/crypto.c | 49 ++++++++++++++++++------------------- src/util/crypto_helper_cs.c | 4 +-- src/util/crypto_wire.c | 6 ++--- src/util/denom.c | 40 ++++++++++++++++-------------- src/util/taler-exchange-secmod-cs.c | 4 +-- src/util/taler-exchange-secmod-cs.h | 2 +- src/util/test_crypto.c | 14 +++++------ 7 files changed, 60 insertions(+), 59 deletions(-) (limited to 'src/util') diff --git a/src/util/crypto.c b/src/util/crypto.c index 9a913afeb..c239f7970 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -156,10 +156,10 @@ TALER_planchet_setup_random ( void -TALER_planchet_setup_refresh (const struct TALER_TransferSecretP *secret_seed, - uint32_t coin_num_salt, - struct TALER_PlanchetSecretsP *ps) - +TALER_transfer_secret_to_planchet_secret ( + const struct TALER_TransferSecretP *secret_seed, + uint32_t coin_num_salt, + struct TALER_PlanchetSecretsP *ps) { uint32_t be_salt = htonl (coin_num_salt); @@ -381,14 +381,14 @@ TALER_blinded_planchet_free (struct TALER_BlindedPlanchet *blinded_planchet) enum GNUNET_GenericReturnValue -TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk, - const struct - TALER_BlindedDenominationSignature *blind_sig, - const union TALER_DenominationBlindingKeyP *bks, - const struct TALER_CoinSpendPrivateKeyP *coin_priv, - const struct TALER_CoinPubHash *c_hash, - const struct TALER_ExchangeWithdrawValues *alg_values, - struct TALER_FreshCoin *coin) +TALER_planchet_to_coin ( + const struct TALER_DenominationPublicKey *dk, + const struct TALER_BlindedDenominationSignature *blind_sig, + const union TALER_DenominationBlindingKeyP *bks, + const struct TALER_CoinSpendPrivateKeyP *coin_priv, + const struct TALER_CoinPubHash *c_hash, + const struct TALER_ExchangeWithdrawValues *alg_values, + struct TALER_FreshCoin *coin) { struct TALER_DenominationSignature sig; @@ -416,21 +416,20 @@ TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk, { struct GNUNET_CRYPTO_CsC c[2]; struct GNUNET_CRYPTO_CsBlindingSecret bs[2]; - struct TALER_DenominationCsPublicR r_pub_blind; - - GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce, bs); - - GNUNET_CRYPTO_cs_calc_blinded_c (bs, - alg_values->details.cs_values.r_pub.r_pub, - &dk->details.cs_public_key, - &c_hash->hash, - sizeof(struct GNUNET_HashCode), - c, - r_pub_blind.r_pub); - + struct TALER_DenominationCSPublicRPairP r_pub_blind; + + GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce, + bs); + GNUNET_CRYPTO_cs_calc_blinded_c ( + bs, + alg_values->details.cs_values.r_pub_pair.r_pub, + &dk->details.cs_public_key, + &c_hash->hash, + sizeof(struct GNUNET_HashCode), + c, + r_pub_blind.r_pub); sig.details.cs_signature.r_point = r_pub_blind.r_pub[blind_sig->details.blinded_cs_answer.b]; - if (GNUNET_OK != TALER_denom_sig_unblind (&sig, blind_sig, diff --git a/src/util/crypto_helper_cs.c b/src/util/crypto_helper_cs.c index 593aa0c25..6374a5a7d 100644 --- a/src/util/crypto_helper_cs.c +++ b/src/util/crypto_helper_cs.c @@ -607,13 +607,13 @@ TALER_CRYPTO_helper_cs_revoke ( } -struct TALER_DenominationCsPublicR +struct TALER_DenominationCSPublicRPairP TALER_CRYPTO_helper_cs_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh, const struct TALER_CsPubHashP *h_cs, const struct TALER_CsNonce *nonce, enum TALER_ErrorCode *ec) { - struct TALER_DenominationCsPublicR r_pub; + struct TALER_DenominationCSPublicRPairP r_pub; memset (&r_pub, 0, diff --git a/src/util/crypto_wire.c b/src/util/crypto_wire.c index e1c7d9646..144b8ee9a 100644 --- a/src/util/crypto_wire.c +++ b/src/util/crypto_wire.c @@ -64,7 +64,7 @@ TALER_exchange_wire_signature_make ( void TALER_merchant_wire_signature_hash (const char *payto_uri, - const struct TALER_WireSalt *salt, + const struct TALER_WireSaltP *salt, struct TALER_MerchantWireHash *hc) { GNUNET_assert (GNUNET_YES == @@ -83,7 +83,7 @@ TALER_merchant_wire_signature_hash (const char *payto_uri, enum GNUNET_GenericReturnValue TALER_merchant_wire_signature_check ( const char *payto_uri, - const struct TALER_WireSalt *salt, + const struct TALER_WireSaltP *salt, const struct TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantSignatureP *merch_sig) { @@ -105,7 +105,7 @@ TALER_merchant_wire_signature_check ( void TALER_merchant_wire_signature_make ( const char *payto_uri, - const struct TALER_WireSalt *salt, + const struct TALER_WireSaltP *salt, const struct TALER_MerchantPrivateKeyP *merch_priv, struct TALER_MerchantSignatureP *merch_sig) { diff --git a/src/util/denom.c b/src/util/denom.c index 88bdd611f..00d7ec791 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -86,7 +86,7 @@ enum GNUNET_GenericReturnValue TALER_denom_cs_derive_r_public (const struct TALER_CsNonce *nonce, const struct TALER_DenominationPrivateKey *denom_priv, - struct TALER_DenominationCsPublicR *r_pub) + struct TALER_DenominationCSPublicRPairP *r_pub) { if (denom_priv->cipher != TALER_DENOMINATION_CS) { @@ -316,13 +316,14 @@ TALER_denom_priv_to_pub (const struct TALER_DenominationPrivateKey *denom_priv, enum GNUNET_GenericReturnValue -TALER_denom_blind (const struct TALER_DenominationPublicKey *dk, - const union TALER_DenominationBlindingKeyP *coin_bks, - const struct TALER_AgeHash *age_commitment_hash, - const struct TALER_CoinSpendPublicKeyP *coin_pub, - const struct TALER_ExchangeWithdrawValues *alg_values, - struct TALER_CoinPubHash *c_hash, - struct TALER_BlindedPlanchet *blinded_planchet) +TALER_denom_blind ( + const struct TALER_DenominationPublicKey *dk, + const union TALER_DenominationBlindingKeyP *coin_bks, + const struct TALER_AgeHash *age_commitment_hash, + const struct TALER_CoinSpendPublicKeyP *coin_pub, + const struct TALER_ExchangeWithdrawValues *alg_values, + struct TALER_CoinPubHash *c_hash, + struct TALER_BlindedPlanchet *blinded_planchet) { TALER_coin_pub_hash (coin_pub, age_commitment_hash, @@ -348,19 +349,20 @@ TALER_denom_blind (const struct TALER_DenominationPublicKey *dk, case TALER_DENOMINATION_CS: { blinded_planchet->cipher = dk->cipher; - struct TALER_DenominationCsPublicR blinded_r_pub; + struct TALER_DenominationCSPublicRPairP blinded_r_pub; struct GNUNET_CRYPTO_CsBlindingSecret bs[2]; - GNUNET_CRYPTO_cs_blinding_secrets_derive (&coin_bks->nonce, bs); - - GNUNET_CRYPTO_cs_calc_blinded_c (bs, - alg_values->details.cs_values.r_pub.r_pub, - &dk->details.cs_public_key, - &c_hash->hash, - sizeof(struct GNUNET_HashCode), - blinded_planchet->details. - cs_blinded_planchet.c, - blinded_r_pub.r_pub); + GNUNET_CRYPTO_cs_blinding_secrets_derive (&coin_bks->nonce, + bs); + GNUNET_CRYPTO_cs_calc_blinded_c ( + bs, + alg_values->details.cs_values.r_pub_pair.r_pub, + &dk->details.cs_public_key, + &c_hash->hash, + sizeof(struct GNUNET_HashCode), + blinded_planchet->details. + cs_blinded_planchet.c, + blinded_r_pub.r_pub); return GNUNET_OK; } default: diff --git a/src/util/taler-exchange-secmod-cs.c b/src/util/taler-exchange-secmod-cs.c index a47e9f220..1c4625e79 100644 --- a/src/util/taler-exchange-secmod-cs.c +++ b/src/util/taler-exchange-secmod-cs.c @@ -553,8 +553,8 @@ handle_r_derive_request (struct TES_Client *client, const struct TALER_CRYPTO_CsRDeriveRequest *rdr) { struct DenominationKey *dk; - struct TALER_DenominationCsPrivateR r_priv; - struct TALER_DenominationCsPublicR r_pub; + struct TALER_DenominationCSPrivateRPairP r_priv; + struct TALER_DenominationCSPublicRPairP r_pub; struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); GNUNET_assert (0 == pthread_mutex_lock (&keys_lock)); diff --git a/src/util/taler-exchange-secmod-cs.h b/src/util/taler-exchange-secmod-cs.h index 6c3f9232a..a6cbfcf23 100644 --- a/src/util/taler-exchange-secmod-cs.h +++ b/src/util/taler-exchange-secmod-cs.h @@ -227,7 +227,7 @@ struct TALER_CRYPTO_RDeriveResponse /** * derived R */ - struct TALER_DenominationCsPublicR r_pub; + struct TALER_DenominationCSPublicRPairP r_pub; }; diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c index 8b136e73f..46ed2b92b 100644 --- a/src/util/test_crypto.c +++ b/src/util/test_crypto.c @@ -68,9 +68,9 @@ test_high_level (void) GNUNET_assert (0 == GNUNET_memcmp (&secret, &secret2)); - TALER_planchet_setup_refresh (&secret, - 0, - &ps1); + TALER_transfer_secret_to_planchet_secret (&secret, + 0, + &ps1); alg1.cipher = TALER_DENOMINATION_RSA; TALER_planchet_setup_coin_priv (&ps1, &alg1, @@ -79,9 +79,9 @@ test_high_level (void) &alg1, &bks1); alg2.cipher = TALER_DENOMINATION_RSA; - TALER_planchet_setup_refresh (&secret, - 1, - &ps2); + TALER_transfer_secret_to_planchet_secret (&secret, + 1, + &ps2); TALER_planchet_setup_coin_priv (&ps2, &alg2, &coin_priv2); @@ -307,7 +307,7 @@ static int test_merchant_sigs (void) { const char *pt = "payto://x-taler-bank/localhost/Account"; - struct TALER_WireSalt salt; + struct TALER_WireSaltP salt; struct TALER_MerchantPrivateKeyP priv; struct TALER_MerchantPublicKeyP pub; struct TALER_MerchantSignatureP sig; -- cgit v1.2.3