donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 520c6e2550402bb3ae6ae6b4e78523b12283c3b3
parent e7de40b1d87191abd1cc0bdc6e61def635af6221
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Wed,  8 Nov 2023 12:10:41 +0100

[util] minor changes

Diffstat:
Msrc/include/donau_crypto_lib.h | 10+++++-----
Msrc/util/charity_signatures.c | 21+++++++++++----------
2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ /** - * @file include/taler_crypto_lib.h + * @file include/donau_crypto_lib.h * @file include/gnunet_crypto_lib.h * @brief taler-specific crypto functions * @author Sree Harsha Totakura <sreeharsha@totakura.in> @@ -23,7 +23,7 @@ * @author Lukas Matyja */ #if ! defined (__TALER_DONAU_UTIL_LIB_H_INSIDE__) -#error "Only <taler_donau_util.h> can be included directly." + #error "Only <donau_util.h> can be included directly." #endif #ifndef TALER_DONAU_CRYPTO_LIB_H @@ -110,7 +110,7 @@ struct TALER_DonauSignatureP /** * Donau uses EdDSA for for non-blind signatures. */ - struct GNUNET_CRYPTO_EddsaSignature eddsa_signature; + struct GNUNET_CRYPTO_EddsaSignature eddsa_sig; }; /** @@ -121,7 +121,7 @@ struct TALER_DONAU_CharitySignatureP /** * Charities use EdDSA signatures. */ - struct GNUNET_CRYPTO_EddsaSignature eddsa_signature; + struct GNUNET_CRYPTO_EddsaSignature eddsa_sig; }; /** @@ -169,7 +169,7 @@ TALER_charity_blinded_unique_donation_identifier_key_pair_verify ( const unsigned int num_bkp, const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[static num_bkp], const struct TALER_DONAU_CharityPublicKeyP *charity_pub, - struct TALER_CharitySignatureP *charity_sig); + const struct TALER_CharitySignatureP *charity_sig); #endif diff --git a/src/util/charity_signatures.c b/src/util/charity_signatures.c @@ -17,6 +17,7 @@ * @file charity_signatures.c * @brief Utility functions for Taler charity signatures * @author Christian Grothoff + * @author Lukas Matyja */ #include "donau_util.h" #include <taler/taler_signatures.h> @@ -30,8 +31,8 @@ TALER_charity_blinded_unique_donation_identifier_key_pair_sign ( struct TALER_CharitySignatureP *charity_sig) { struct TALER_BudiKeyPairTrackPS tps = { - .purpose.size = htonl (sizeof (bk[0])* num_bkp), - .purpose.purpose = htonl (TALER_SIGNATURE_CHARITY_TRACK_TRANSACTION), + .purpose.size = htonl (sizeof (bkp[0])* num_bkp), + .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION), .bkp = *bkp, }; @@ -40,16 +41,16 @@ TALER_charity_blinded_unique_donation_identifier_key_pair_sign ( &charity_sig->eddsa_sig); } -GNUNET_NETWORK_STRUCT_BEGIN + /** * @brief Format used to generate the signature on a request to obtain - * the wire transfer identifier associated with a deposit. + * the wire transfer identifier associated with a donation. */ -struct TALER_DepositTrackPS +struct TALER_BudiKeyPairTrackPS { /** - * Purpose must be #TALER_SIGNATURE_CHARITY_TRACK_TRANSACTION. + * Purpose must be #TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION. */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; @@ -66,24 +67,24 @@ struct TALER_DepositTrackPS }; -GNUNET_NETWORK_STRUCT_END + enum GNUNET_GenericReturnValue TALER_charity_blinded_unique_donation_identifier_key_pair_verify ( const unsigned int num_bkp, const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[static num_bkp], const struct TALER_DONAU_CharityPublicKeyP *charity_pub, - struct TALER_CharitySignatureP *charity_sig) + const struct TALER_CharitySignatureP *charity_sig) { struct TALER_BudiKeyPairTrackPS tps = { - .purpose.size = htonl (sizeof (bk[0])* num_bkp), + .purpose.size = htonl (sizeof (bkp[0])* num_bkp), .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION), .num_bkp = num_bkp, .bkp = *bkp }; return - GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_CHARITY_TRACK_TRANSACTION, + GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION, &tps, &charity_sig->eddsa_sig, &charity_pub->eddsa_pub);