diff options
Diffstat (limited to 'src/include/donau_crypto_lib.h')
-rw-r--r-- | src/include/donau_crypto_lib.h | 165 |
1 files changed, 42 insertions, 123 deletions
diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h index bc3049d..a6f2296 100644 --- a/src/include/donau_crypto_lib.h +++ b/src/include/donau_crypto_lib.h @@ -23,6 +23,7 @@ * @author Lukas Matyja * @author Pius Loosli */ + #if ! defined (__DONAU_UTIL_LIB_H_INSIDE__) #error "Only <donau_util.h> can be included directly." #endif @@ -323,14 +324,6 @@ struct DONAU_BkpSignData const struct DONAU_BlindedUniqueDonorIdentifier *budi; }; -/** USED? - * Hash of a budikeypair array - */ -// struct DONAU_BudiHashP -// { -// struct GNUNET_HashCode hash; -// }; - /** * Hash of a Unique Donor Identifier (h_donor_tax_id + nonce) */ @@ -372,6 +365,33 @@ struct DONAU_BudiMasterSecretP }; +/** + * Donation Statement + */ +struct DONAU_DonationStatement +{ + /** + * The corresponding year. + */ + uint64_t year; + + /** + * The salted and hashed donor id. + */ + struct DONAU_HashDonorTaxId *h_donor_tax_id; + + /** + * The total donated amount. + */ + struct TALER_Amount total_amount; + + /** + * The donation statement signature over @year, @h_donor_tax_id and @total_amount. + */ + struct DONAU_DonauSignatureP donation_statement_sig; + +}; + /* ********************* charity eddsa signing ************************** */ @@ -462,7 +482,7 @@ DONAU_donation_statement_sign ( enum GNUNET_GenericReturnValue DONAU_donation_statement_verify ( const struct TALER_Amount *amount_tot, - const uint32_t year, + const uint64_t year, const struct DONAU_HashDonorTaxId *i, const struct DONAU_DonauPublicKeyP *donau_pub, const struct DONAU_DonauSignatureP *statement_sig); @@ -512,120 +532,6 @@ TALER_donation_unit_pub_verify (const struct const struct DONAU_BudiHashP *budi_hash); -// FIXME: Copied from taler_crypto_lib.h, is anything of this necessary? -///** -// * Compute the hash of the given @a donation_unit_pub. -// * -// * @param donation_unit_pub public key to hash -// * @param[out] h_donation_unit_pub resulting hash value -// */ -// void -// TALER_donation_unit_pub_hash (const struct DONAU_DonationUnitPublicKey *donation_unit_pub, -// struct DONAU_DonationUnitHashP *h_donation_unit_pub); -// -// -///** -// * Make a (deep) copy of the given @a donation_unit_src to -// * @a donation_unit_dst. -// * -// * @param[out] donation_unit_dst target to copy to -// * @param donation_unit_src public key to copy -// */ -// void -// TALER_donation_unit_pub_deep_copy (struct DONAU_DonationUnitPublicKey *donation_unit_dst, -// const struct DONAU_DonationUnitPublicKey *donation_unit_src); -// -// -///** -// * Make a (deep) copy of the given @a donation_unit_src to -// * @a donation_unit_dst. -// * -// * @param[out] donation_unit_dst target to copy to -// * @param donation_unit_src public key to copy -// */ -// void -// TALER_donation_unit_sig_deep_copy (struct DONAU_DonationUnitSignature *donation_unit_dst, -// const struct DONAU_DonationUnitSignature *donation_unit_src); -// -// -///** -// * Make a (deep) copy of the given @a donation_unit_src to -// * @a donation_unit_dst. -// * -// * @param[out] donation_unit_dst target to copy to -// * @param donation_unit_src public key to copy -// */ -// void -// TALER_blinded_donation_unit_sig_deep_copy ( -// struct DONAU_BlindedDonationUnitSignature *donation_unit_dst, -// const struct DONAU_BlindedDonationUnitSignature *donation_unit_src); -// -// -///** -// * Compare two donation unit public keys. -// * -// * @param donation_unit1 first key -// * @param donation_unit2 second key -// * @return 0 if the keys are equal, otherwise -1 or 1 -// */ -// int -// TALER_donation_unit_pub_cmp (const struct DONAU_DonationUnitPublicKey *donation_unit1, -// const struct DONAU_DonationUnitPublicKey *donation_unit2); -// -// -///** -// * Compare two donation unit signatures. -// * -// * @param sig1 first signature -// * @param sig2 second signature -// * @return 0 if the keys are equal, otherwise -1 or 1 -// */ -// int -// TALER_donation_unit_sig_cmp (const struct DONAU_DonationUnitSignature *sig1, -// const struct DONAU_DonationUnitSignature *sig2); -// -// -///** -// * Compare two blinded donation unit signatures. -// * -// * @param sig1 first signature -// * @param sig2 second signature -// * @return 0 if the keys are equal, otherwise -1 or 1 -// */ -// int -// TALER_blinded_donation_unit_sig_cmp ( -// const struct DONAU_BlindedDonationUnitSignature *sig1, -// const struct DONAU_BlindedDonationUnitSignature *sig2); -// -// -///** -// * Compare two blinded planchets. -// * -// * @param bp1 first blinded planchet -// * @param bp2 second blinded planchet -// * @return 0 if the keys are equal, otherwise -1 or 1 -// */ -// int -// TALER_blinded_planchet_cmp ( -// const struct DONAU_BlindedPlanchet *bp1, -// const struct DONAU_BlindedPlanchet *bp2); -// -// -///** -// * Verify signature made with a donation unit public key -// * over a donation receipt. -// * -// * @param donation_unit_pub public donation unit key -// * @param donation_unit_sig signature made with the private key -// * @param c_hash hash over the coin -// * @return #GNUNET_OK if the signature is valid -// */ -// enum GNUNET_GenericReturnValue -// TALER_donation_unit_pub_verify (const struct DONAU_DonationUnitPublicKey *donation_unit_pub, -// const struct DONAU_DonationUnitSignature *donation_unit_sig, -// const struct DONAU_ *c_hash); -// - /* ********************* client blind/unblind ************************** */ /** @@ -654,6 +560,19 @@ DONAU_donation_unit_ewv_rsa_singleton (void); /** + * Make a (deep) copy of the given @a bi_src to + * @a bi_dst. + * + * @param[out] bi_dst target to copy to + * @param bi_src blinding input values to copy + */ +void +DONAU_donation_unit_ewv_copy ( + struct DONAU_BatchIssueValues *bi_dst, + const struct DONAU_BatchIssueValues *bi_src); + + +/** * Blind udi for blind signing with @a du_pub using blinding secret @a budi_secret. * * NOTE: As a particular oddity, the @a budi is only partially |