donau

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

commit b2ea5fd242e33c60b3639738c90ff8a283a1df64
parent 7189fd1affa3e5bcbdab5c7c3514deb8f415e65b
Author: Pius Loosli <loosp2@bfh.ch>
Date:   Mon, 20 Nov 2023 19:33:18 +0100

[header] rename prefix to DONAU_, discard TALER_DONAU

Diffstat:
Msrc/include/donau_crypto_lib.h | 58+++++++++++++++++++++++++++++-----------------------------
Msrc/include/donau_util.h | 2+-
Msrc/util/charity_signatures.c | 30+++++++++++++++---------------
Msrc/util/donau_signatures.c | 20++++++++++----------
4 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h @@ -22,12 +22,12 @@ * @author Özgür Kesim <oec-taler@kesim.org> * @author Lukas Matyja */ -#if ! defined (__TALER_DONAU_UTIL_LIB_H_INSIDE__) +#if ! defined (__DONAU_UTIL_LIB_H_INSIDE__) #error "Only <donau_util.h> can be included directly." #endif -#ifndef TALER_DONAU_CRYPTO_LIB_H -#define TALER_DONAU_CRYPTO_LIB_H +#ifndef DONAU_CRYPTO_LIB_H +#define DONAU_CRYPTO_LIB_H #include <gnunet/gnunet_util_lib.h> #include "taler/taler_error_codes.h" @@ -40,7 +40,7 @@ /** * Regular online message signing key used by Donau. */ -struct TALER_DONAU_EddsaPublicKeyP +struct DONAU_EddsaPublicKeyP { /** * Donau uses EdDSA for non-blind signing. @@ -53,7 +53,7 @@ struct TALER_DONAU_EddsaPublicKeyP * @brief Private key used by the donau to * sign messages. */ -struct TALER_DONAU_PrivateKeyP +struct DONAU_PrivateKeyP { /** * Donau uses EdDSA for non-blind signing. @@ -65,7 +65,7 @@ struct TALER_DONAU_PrivateKeyP /** * Signing key for whole batches of BUDI-key-pairs. Used by a Charity. */ -struct TALER_DONAU_CharityPublicKeyP +struct DONAU_CharityPublicKeyP { /** * Donau uses EdDSA for BUDI-key-pair signing @@ -77,7 +77,7 @@ struct TALER_DONAU_CharityPublicKeyP /** * Signing key for whole batches of BUDI-key-pairs. Used by a Charity. */ -struct TALER_DONAU_CharityPrivateKeyP +struct DONAU_CharityPrivateKeyP { /** * Donau uses EdDSA for BUDI-key-pair signing @@ -89,7 +89,7 @@ struct TALER_DONAU_CharityPrivateKeyP /** * Hash of a donation unit public key */ -struct TALER_DonationUnitHashP +struct DONAU_DonationUnitHashP { struct GNUNET_HashCode hash; }; @@ -97,7 +97,7 @@ struct TALER_DonationUnitHashP /** * Donor's hashed and salted unique donation identifier. */ -struct TALER_DONAU_HashDonorTaxId +struct DONAU_HashDonorTaxId { struct GNUNET_HashCode hash; }; @@ -105,7 +105,7 @@ struct TALER_DONAU_HashDonorTaxId /** * blind signatures from the blinded donation envelopes. */ -struct TALER_BlindedDonationUnitSignature +struct DONAU_BlindedDonationUnitSignature { /** * The blinded signature @@ -118,7 +118,7 @@ struct TALER_BlindedDonationUnitSignature /** * @brief Type of signature used by the donau for non-blind signatures. */ -struct TALER_DonauSignatureP +struct DONAU_DonauSignatureP { /** * Donau uses EdDSA for for non-blind signatures. @@ -129,7 +129,7 @@ struct TALER_DonauSignatureP /** * @brief Type of signature used by charities */ -struct TALER_CharitySignatureP +struct DONAU_CharitySignatureP { /** * Charities use EdDSA signatures. @@ -140,7 +140,7 @@ struct TALER_CharitySignatureP /** * Token used for access control for admin to the donau. */ -struct TALER_DONAU_BearerToken +struct DONAU_BearerToken { /** * The token is a 128-bit UUID. @@ -151,7 +151,7 @@ struct TALER_DONAU_BearerToken /* * @brief Wrapper around GNUNET primitive for the blinded unique donation identifier */ -struct TALER_BlindedUniqueDonationIdentifier +struct DONAU_BlindedUniqueDonationIdentifier { /* * GNUNET primitive type representing a generic blinded message @@ -162,19 +162,19 @@ struct TALER_BlindedUniqueDonationIdentifier /** * Information needed for a donation receipt to be signed. */ -struct TALER_BlindedUniqueDonationIdentifierKeyPair +struct DONAU_BlindedUniqueDonationIdentifierKeyPair { /** * The hash of the donation unit's public key. */ - struct TALER_DonationUnitHashP h_donation_unit_pub; + struct DONAU_DonationUnitHashP h_donation_unit_pub; /** * Donor's blinded donation receipt to be blindly * signed. */ - struct TALER_BlindedUniqueDonationIdentifier blinded_udi; + struct DONAU_BlindedUniqueDonationIdentifier blinded_udi; }; @@ -193,10 +193,10 @@ struct TALER_BlindedUniqueDonationIdentifierKeyPair void DONAU_charity_budi_key_pair_sign ( const unsigned int num_bkp, - const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[static + const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *bkp[static num_bkp], - const struct TALER_DONAU_CharityPrivateKeyP *charity_priv, - struct TALER_CharitySignatureP *charity_sig); + const struct DONAU_CharityPrivateKeyP *charity_priv, + struct DONAU_CharitySignatureP *charity_sig); /** @@ -211,10 +211,10 @@ DONAU_charity_budi_key_pair_sign ( enum GNUNET_GenericReturnValue DONAU_charity_budi_key_pair_verify ( const unsigned int num_bkp, - const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[static + const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *bkp[static num_bkp], - const struct TALER_DONAU_CharityPublicKeyP *charity_pub, - const struct TALER_CharitySignatureP *charity_sig); + const struct DONAU_CharityPublicKeyP *charity_pub, + const struct DONAU_CharitySignatureP *charity_sig); /* ********************* donau eddsa signing ************************** */ @@ -234,9 +234,9 @@ void DONAU_donation_statement_sign ( const struct TALER_Amount *amount_tot, const unsigned int year, - const struct TALER_DONAU_HashDonorTaxId *i, - const struct TALER_DONAU_PrivateKeyP *donau_priv, - struct TALER_DonauSignatureP *statement_sig); + const struct DONAU_HashDonorTaxId *i, + const struct DONAU_PrivateKeyP *donau_priv, + struct DONAU_DonauSignatureP *statement_sig); /** @@ -253,9 +253,9 @@ enum GNUNET_GenericReturnValue DONAU_donation_statement_verify ( const struct TALER_Amount *amount_tot, const unsigned int year, - const struct TALER_DONAU_HashDonorTaxId *i, - const struct TALER_DONAU_EddsaPublicKeyP *donau_pub, - const struct TALER_DonauSignatureP *statement_sig); + const struct DONAU_HashDonorTaxId *i, + const struct DONAU_EddsaPublicKeyP *donau_pub, + const struct DONAU_DonauSignatureP *statement_sig); #endif diff --git a/src/include/donau_util.h b/src/include/donau_util.h @@ -22,7 +22,7 @@ #define DONAU_UTIL_H #include <gnunet/gnunet_common.h> -#define __TALER_DONAU_UTIL_LIB_H_INSIDE__ +#define __DONAU_UTIL_LIB_H_INSIDE__ #include <gnunet/gnunet_util_lib.h> #include <microhttpd.h> diff --git a/src/util/charity_signatures.c b/src/util/charity_signatures.c @@ -34,11 +34,11 @@ GNUNET_NETWORK_STRUCT_BEGIN * identifiers and key pairs as a agreement of the charity with the * donation request from the donor. */ -struct TALER_BudiKeyPairTrackPS +struct DONAU_BudiKeyPairTrackPS { /** - * Purpose must be #TALER_SIGNATURE_DONAU_CHARITY_DONATION_CONFIRMATION. Signed - * by a `struct TALER_CharityPublicKeyP` using EdDSA. + * Purpose must be #DONAU_SIGNATURE_DONAU_CHARITY_DONATION_CONFIRMATION. Signed + * by a `struct DONAU_CharityPublicKeyP` using EdDSA. */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; @@ -59,19 +59,19 @@ GNUNET_NETWORK_STRUCT_END void DONAU_charity_budi_key_pair_sign ( const unsigned int num_bkp, - const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[num_bkp], - const struct TALER_DONAU_CharityPrivateKeyP *charity_priv, - struct TALER_CharitySignatureP *charity_sig) + const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *bkp[num_bkp], + const struct DONAU_CharityPrivateKeyP *charity_priv, + struct DONAU_CharitySignatureP *charity_sig) { - struct TALER_BudiKeyPairTrackPS tps = { + struct DONAU_BudiKeyPairTrackPS tps = { .purpose.purpose = htonl (DONAU_SIGNATURE_CHARITY_DONATION_CONFIRMATION), .purpose.size = htonl (sizeof (tps)), .num_bkp = htonl (num_bkp) }; GNUNET_CRYPTO_hash (bkp, - sizeof (bkp[0]) * num_bkp, - &tps.bkps_hash); + sizeof (bkp[0]) * num_bkp, + &tps.bkps_hash); GNUNET_CRYPTO_eddsa_sign (&charity_priv->eddsa_priv, &tps, @@ -82,19 +82,19 @@ DONAU_charity_budi_key_pair_sign ( enum GNUNET_GenericReturnValue DONAU_charity_budi_key_pair_verify ( const unsigned int num_bkp, - const struct TALER_BlindedUniqueDonationIdentifierKeyPair *bkp[num_bkp], - const struct TALER_DONAU_CharityPublicKeyP *charity_pub, - const struct TALER_CharitySignatureP *charity_sig) + const struct DONAU_BlindedUniqueDonationIdentifierKeyPair *bkp[num_bkp], + const struct DONAU_CharityPublicKeyP *charity_pub, + const struct DONAU_CharitySignatureP *charity_sig) { - struct TALER_BudiKeyPairTrackPS tps = { + struct DONAU_BudiKeyPairTrackPS tps = { .purpose.size = htonl (sizeof (bkp[0]) * num_bkp), .purpose.purpose = htonl (DONAU_SIGNATURE_CHARITY_DONATION_CONFIRMATION), .num_bkp = htonl (num_bkp) }; GNUNET_CRYPTO_hash (bkp, - sizeof (bkp[0]) * num_bkp, - &tps.bkps_hash); + sizeof (bkp[0]) * num_bkp, + &tps.bkps_hash); return GNUNET_CRYPTO_eddsa_verify (DONAU_SIGNATURE_CHARITY_DONATION_CONFIRMATION, diff --git a/src/util/donau_signatures.c b/src/util/donau_signatures.c @@ -63,13 +63,13 @@ void DONAU_donation_statement_sign ( const struct TALER_Amount *amount_tot, const unsigned int year, - const struct TALER_DONAU_HashDonorTaxId *i, - const struct TALER_DONAU_PrivateKeyP *donau_priv, - struct TALER_DonauSignatureP *statement_sig) + const struct DONAU_HashDonorTaxId *i, + const struct DONAU_PrivateKeyP *donau_priv, + struct DONAU_DonauSignatureP *statement_sig) { - struct TALER_DonationStatementConfirmationPS tps = { + struct DONAU_DonationStatementConfirmationPS tps = { .purpose.size = htonl (sizeof (struct - TALER_DonationStatementConfirmationPS)), + DONAU_DonationStatementConfirmationPS)), .purpose.purpose = htonl (DONAU_SIGNATURE_DONAU_DONATION_STATEMENT), .year = htonl (year), .i = *i @@ -88,13 +88,13 @@ enum GNUNET_GenericReturnValue DONAU_donation_statement_verify ( const struct TALER_Amount *amount_tot, const unsigned int year, - const struct TALER_DONAU_HashDonorTaxId *i, - const struct TALER_DONAU_EddsaPublicKeyP *donau_pub, - const struct TALER_DonauSignatureP *statement_sig) + const struct DONAU_HashDonorTaxId *i, + const struct DONAU_EddsaPublicKeyP *donau_pub, + const struct DONAU_DonauSignatureP *statement_sig) { - struct TALER_DonationStatementConfirmationPS tps = { + struct DONAU_DonationStatementConfirmationPS tps = { .purpose.size = htonl (sizeof (struct - TALER_DonationStatementConfirmationPS)), + DONAU_DonationStatementConfirmationPS)), .purpose.purpose = htonl (DONAU_SIGNATURE_DONAU_DONATION_STATEMENT), .year = htonl (year), .i = *i