commit 9b07f0632131a65fcb8e3061c79b5055605a69b4
parent 50d96762ff8b812257267a5184d0e5917d9921a0
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date: Tue, 17 Oct 2023 11:30:04 +0200
[header] statement processing
Diffstat:
1 file changed, 112 insertions(+), 12 deletions(-)
diff --git a/src/include/taler_donau_service.h b/src/include/taler_donau_service.h
@@ -520,12 +520,12 @@ struct TALER_DONAU_BlindedDonationReceipt
/**
* blind signatures from the blinded donation envelopes.
*/
-struct TALER_DonauBlindSignatureP
+struct TALER_BlindedDonationUnitSignature
{
/**
* The blinded signature
*/
- struct TALER_DenominationSignature sig;
+ struct TALER_DenominationSignature b_sig;
};
@@ -561,7 +561,7 @@ struct TALER_DONAU_BatchIssueReceiptResult
/**
* Blind signature provided by the donau
*/
- const struct TALER_DonauBlindSignatureP *donau_sigs;
+ const struct TALER_BlindedDonationUnitSignature *donau_sigs;
/**
* total amount over all donation receipts of a year specified by the request.
@@ -629,7 +629,6 @@ TALER_DONAU_charity_issue_receipt (
TALER_DONAU_BatchIssueReceiptResultCallback cb,
void *cb_cls);
-
/**
* Cancel a batch permission request. This function cannot be used
* on a request handle if a response is already served for it.
@@ -640,19 +639,120 @@ void
TALER_DONAU_charity_issue_receipt_cancel (
struct TALER_DONAU_BatchIssueReceiptHandle *);
+/**
+ * @brief Type of signatures used by the donau for non-blind signatures.
+ */
+struct TALER_DonauSignatureP
+{
+ /**
+ * Donau uses EdDSA for for non-blind signatures.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature eddsa_signature;
+};
+
+/**
+ * unblinded donation unit signature from Donau
+ */
+struct TALER_DonationUnitSignature
+{
+ /**
+ * The unblinded signature
+ */
+ struct TALER_DenominationSignature sig;
+
+};
+
+/**
+ * Donation Receipt
+ */
+struct TALER_DONAU_DonationReceipt
+{
+
+ /**
+ * The hash of the donation unit's public key.
+ */
+ struct TALER_DonationUnitHashP h_donation_unit_pub;
+
+ /**
+ * Donor's unique donation identifier.
+ */
+ struct TALER_DONAU_HashDonorTaxId donor_id;
+
+ /**
+ * Unblinded donation unit signature from the donau.
+ */
+ struct TALER_DonationUnitSignature sig;
+
+};
+
+/**
+ * @brief A Batch Submit Handle
+ */
+struct TALER_DONAU_DonorReceiptsToStatementHandle;
+
+
+/**
+ * Structure with information about a batch
+ * operation's result.
+ */
+struct TALER_DONAU_DonorReceiptsToStatementResult
+{
+ /**
+ * HTTP response data
+ */
+ struct TALER_DONAU_HttpResponse hr;
+
+ union
+ {
+
+ /**
+ * Information returned if the HTTP status is
+ * #MHD_HTTP_OK.
+ */
+ struct
+ {
+ /**
+ * total amount of the donation statement for the requested year
+ */
+ struct TALER_Amount total_amount;
+
+ /**
+ * The donation statment for a requested year. Signature over the total amount,
+ * the year, the unique identifier hash
+ */
+ struct TALER_DonauSignatureP *sig;
-// + data types
+ } ok;
-struct TALER_DONAU_BatchSubmitHandle *
+ struct
+ {
+ /* TODO: returning full details is not implemented */
+ } conflict;
+
+ } details;
+};
+
+
+/**
+ * Callbacks of this type are used to serve the result of submitting a
+ * permission request to a donau.
+ *
+ * @param cls closure
+ * @param dr response details
+ */
+typedef void
+(*TALER_DONAU_DonorReceiptsToStatementResultCallback) (
+ void *cls,
+ const struct TALER_DONAU_DonorReceiptsToStatementResult *dr);
+
+struct TALER_DONAU_DonorReceiptsToStatementHandle *
TALER_DONAU_donor_receipts_to_statement (
struct GNUNET_CURL_Context *ctx,
const char *url,
- struct TALER_DONAU_Keys *keys,
- const struct TALER_DONAU_HashDonorTaxId *donor_id,
unsigned int num_drs,
- const struct TALER_DONAU_DonauSignaturesAndPublicKey drs[static num_drs],
- TALER_DONAU_XXXBatchSubmitResultCallback cb,
- void *cb_cls);
+ const struct TALER_DONAU_DonationReceipt drs[static num_drs],
+ TALER_DONAU_DonorReceiptsToStatementResultCallback cb,
+ void *cls);
/**
* Cancel a batch permission request. This function cannot be used
@@ -662,7 +762,7 @@ TALER_DONAU_donor_receipts_to_statement (
*/
void
TALER_DONAU_donor_receipts_to_statement_cancel (
- struct TALER_DONAU_BatchSubmitHandle *);
+ struct TALER_DONAU_DonorReceiptsToStatementHandle *);