aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_signatures.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-09 18:18:59 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-09 18:18:59 +0100
commit0430d6fb031d1713a39a996068387c3ab2c36c2d (patch)
treedf1e2813dde318f8af2c92fc2367c3956cd58f28 /src/include/taler_signatures.h
parentf5e49d926ad1dddcfc87b5fb6671a1934aef7b3c (diff)
moving structs relevant for signatures into taler_signatures.h, splitting of private keys that are not in messages; moving test_hash_context to GNUnet
Diffstat (limited to 'src/include/taler_signatures.h')
-rw-r--r--src/include/taler_signatures.h143
1 files changed, 139 insertions, 4 deletions
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 8c142f61f..238a915c1 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -13,18 +13,25 @@
You should have received a copy of the GNU General Public License along with
TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
*/
-
/**
- * @file taler-mint-keyup.c
- * @brief Update the mint's keys for coins and signatures,
- * using the mint's offline master key.
+ * @file taler_signatures.h
+ * @brief message formats and signature constants used to define
+ * the binary formats of signatures in Taler
* @author Florian Dold
* @author Benedikt Mueller
+ *
+ * This file should define the constants and C structs that one
+ * needs to know to implement Taler clients (wallets or merchants)
+ * that need to produce or verify Taler signatures.
*/
#ifndef TALER_SIGNATURES_H
#define TALER_SIGNATURES_H
+#include <gnunet/gnunet_util_lib.h>
+#include "taler_rsa.h"
+
+
/**
* Purpose for signing public keys signed
* by the mint master key.
@@ -102,5 +109,133 @@
*/
#define TALER_SIGNATURE_INCREMENTAL_DEPOSIT 202
+
+
+GNUNET_NETWORK_STRUCT_BEGIN
+
+
+/**
+ * Request to withdraw coins from a reserve.
+ */
+struct TALER_WithdrawRequest
+{
+ /**
+ * Signature over the rest of the message
+ * by the withdraw public key.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature sig;
+
+ /**
+ * Purpose must be #TALER_SIGNATURE_WITHDRAW.
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+ /**
+ * Reserve public key.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub;
+
+ /**
+ * Denomination public key for the coin that is withdrawn.
+ * FIXME: change to the hash of the public key (so this
+ * is fixed-size).
+ */
+ struct TALER_RSA_PublicKeyBinaryEncoded denomination_pub;
+
+ /**
+ * Purpose containing coin's blinded public key.
+ *
+ * FIXME: this should be explicitly a variable-size field with the
+ * (blinded) message to be signed by the Mint.
+ */
+ struct TALER_RSA_BlindedSignaturePurpose coin_envelope;
+};
+
+
+
+/**
+ * FIXME
+ */
+struct TALER_MINT_SignKeyIssue
+{
+ struct GNUNET_CRYPTO_EddsaSignature signature;
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_CRYPTO_EddsaPublicKey master_pub;
+ struct GNUNET_TIME_AbsoluteNBO start;
+ struct GNUNET_TIME_AbsoluteNBO expire;
+ struct GNUNET_CRYPTO_EddsaPublicKey signkey_pub;
+};
+
+
+/**
+ * FIXME
+ */
+struct TALER_MINT_DenomKeyIssue
+{
+ struct GNUNET_CRYPTO_EddsaSignature signature;
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_CRYPTO_EddsaPublicKey master;
+ struct GNUNET_TIME_AbsoluteNBO start;
+ struct GNUNET_TIME_AbsoluteNBO expire_withdraw;
+ struct GNUNET_TIME_AbsoluteNBO expire_spend;
+ struct TALER_RSA_PublicKeyBinaryEncoded denom_pub;
+ struct TALER_AmountNBO value;
+ struct TALER_AmountNBO fee_withdraw;
+ struct TALER_AmountNBO fee_deposit;
+ struct TALER_AmountNBO fee_refresh;
+};
+
+
+/**
+ * FIXME
+ */
+struct RefreshMeltSignatureBody
+{
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_HashCode melt_hash;
+};
+
+/**
+ * FIXME
+ */
+struct RefreshCommitSignatureBody
+{
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_HashCode commit_hash;
+};
+
+
+/**
+ * FIXME
+ */
+struct RefreshCommitResponseSignatureBody
+{
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ uint16_t noreveal_index;
+};
+
+
+/**
+ * FIXME
+ */
+struct RefreshMeltResponseSignatureBody
+{
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_HashCode melt_response_hash;
+};
+
+
+/**
+ * FIXME
+ */
+struct RefreshMeltConfirmSignRequestBody
+{
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_CRYPTO_EddsaPublicKey session_pub;
+};
+
+
+GNUNET_NETWORK_STRUCT_END
+
#endif