[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-donau] branch master updated: [util] create blind sign function
From: |
gnunet |
Subject: |
[taler-donau] branch master updated: [util] create blind sign function |
Date: |
Wed, 20 Mar 2024 00:44:14 +0100 |
This is an automated email from the git hooks/post-receive script.
lukas-matyja pushed a commit to branch master
in repository donau.
The following commit(s) were added to refs/heads/master by this push:
new 37af642 [util] create blind sign function
37af642 is described below
commit 37af64260f7011e640daa52009510250254812a2
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
AuthorDate: Wed Mar 20 00:44:57 2024 +0100
[util] create blind sign function
---
src/include/donau_crypto_lib.h | 51 +++++++++++++++++++++++++++++++++++++++++-
src/util/donau_signatures.c | 14 ++++++++++++
2 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/src/include/donau_crypto_lib.h b/src/include/donau_crypto_lib.h
index b35b1fd..fd1a995 100644
--- a/src/include/donau_crypto_lib.h
+++ b/src/include/donau_crypto_lib.h
@@ -201,6 +201,18 @@ struct DONAU_BlindedDonationUnitSignature
};
+/**
+ * @brief Type of (unblinded) donation receipts signatures for Taler.
+ */
+struct DONAU_DonationUnitSignature
+{
+ /**
+ * Denominations use blind signatures.
+ */
+ struct GNUNET_CRYPTO_UnblindedSignature *unblinded_sig;
+};
+
+
/**
* @brief Type of signature used by the donau for non-blind signatures.
*/
@@ -242,7 +254,7 @@ struct DONAU_BlindedUniqueDonationIdentifier
/*
* GNUNET primitive type representing a generic blinded message
*/
- struct GNUNET_CRYPTO_BlindedMessage blinded_message;
+ struct GNUNET_CRYPTO_BlindedMessage *blinded_message;
};
/**
@@ -272,6 +284,14 @@ struct DONAU_BudiKeyPairsHashP
struct GNUNET_HashCode hash;
};
+/**
+ * Hash of a budikeypair array
+ */
+struct DONAU_BudiHashP
+{
+ struct GNUNET_HashCode hash;
+};
+
/* ********************* charity eddsa signing ************************** */
@@ -364,6 +384,35 @@ void
DONAU_blinded_donation_unit_sig_free (
struct DONAU_BlindedDonationUnitSignature *donation_unit_sig);
+/**
+ * Create blinded signature.
+ *
+ * @param[out] du_sig where to write the signature
+ * @param du_priv private key to use for signing
+ * @param budi the unique identifier already blinded
+ * @return #GNUNET_OK on success
+ */
+enum GNUNET_GenericReturnValue
+TALER_donation_unit_sign_blinded (struct DONAU_BlindedDonationUnitSignature
*du_sig,
+ const struct DONAU_DonationUnitPrivateKey *du_priv,
+ const struct DONAU_BlindedUniqueDonationIdentifier
*budi);
+
+
+/**
+ * Verify signature made with a donation unit public key
+ * over a budi.
+ *
+ * @param du_pub public donation unit key
+ * @param du_sig signature made with the private key
+ * @param budi_hash hash over the budi
+ * @return #GNUNET_OK if the signature is valid
+ */
+enum GNUNET_GenericReturnValue
+TALER_donation_unit_pub_verify (const struct DONAU_DonationUnitPublicKey
*du_pub,
+ const struct DONAU_DonationUnitSignature *du_sig,
+ 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.
diff --git a/src/util/donau_signatures.c b/src/util/donau_signatures.c
index 3468baf..c03efe4 100644
--- a/src/util/donau_signatures.c
+++ b/src/util/donau_signatures.c
@@ -111,4 +111,18 @@ DONAU_donation_statement_verify (
}
+enum GNUNET_GenericReturnValue
+TALER_donation_unit_sign_blinded (struct DONAU_BlindedDonationUnitSignature
*du_sig,
+ const struct DONAU_DonationUnitPrivateKey *du_priv,
+ const struct DONAU_BlindedUniqueDonationIdentifier
*budi)
+{
+ du_sig->blinded_sig
+ = GNUNET_CRYPTO_blind_sign (du_priv->bsign_priv_key,
+ /*for_melt ? "rm" :*/ "rw",
+ budi->blinded_message);
+ if (NULL == du_sig->blinded_sig)
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
+}
+
/* end of donau_signatures.c */
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-donau] branch master updated: [util] create blind sign function,
gnunet <=