summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h304
-rw-r--r--src/include/taler_mint_service.h22
-rw-r--r--src/include/taler_signatures.h31
3 files changed, 324 insertions, 33 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index db663612c..0c0ad8865 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -28,6 +28,296 @@
/* ****************** Coin crypto primitives ************* */
/**
+ * Type of public keys for Taler reserves.
+ */
+struct TALER_ReservePublicKey
+{
+ /**
+ * Taler uses EdDSA for reserves.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
+};
+
+
+/**
+ * Type of private keys for Taler reserves.
+ */
+struct TALER_ReservePrivateKey
+{
+ /**
+ * Taler uses EdDSA for reserves.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
+ * Type of signatures used with Taler reserves.
+ */
+struct TALER_ReserveSignature
+{
+ /**
+ * Taler uses EdDSA for reserves.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature eddsa_signature;
+};
+
+
+/**
+ * Type of public keys to for merchant authorizations.
+ * Merchants can issue refunds using the corresponding
+ * private key.
+ */
+struct TALER_MerchantPublicKey
+{
+ /**
+ * Taler uses EdDSA for merchants.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
+};
+
+
+/**
+ * Type of private keys for merchant authorizations.
+ * Merchants can issue refunds using the corresponding
+ * private key.
+ */
+struct TALER_MerchantPrivateKey
+{
+ /**
+ * Taler uses EdDSA for merchants.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
+ * Type of public keys used by clients to sign
+ * messages during a melting session.
+ */
+struct TALER_SessionPublicKey
+{
+ /**
+ * Taler uses EdDSA for melting session keys.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
+};
+
+
+/**
+ * Type of public keys used by clients to sign
+ * messages during a melting session.
+ */
+struct TALER_SessionPrivateKey
+{
+ /**
+ * Taler uses EdDSA for melting session keys.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
+ * Type of transfer public keys used during refresh
+ * operations.
+ */
+struct TALER_TransferPublicKey
+{
+ /**
+ * Taler uses ECDSA for transfer keys.
+ * FIXME: should this not be ECDHE?
+ */
+ struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_pub;
+};
+
+
+/**
+ * Type of transfer public keys used during refresh
+ * operations.
+ */
+struct TALER_TransferPrivateKey
+{
+ /**
+ * Taler uses ECDSA for melting session keys.
+ * FIXME: should this not be ECDHE?
+ */
+ struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_priv;
+};
+
+
+/**
+ * Type of signatures used by clients to sign
+ * messages during a melting session.
+ */
+struct TALER_SessionSignature
+{
+ /**
+ * Taler uses EdDSA for melting session keys.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature eddsa_signature;
+};
+
+
+/**
+ * Type of online public keys used by the mint to sign
+ * messages.
+ */
+struct TALER_MintPublicKey
+{
+ /**
+ * Taler uses EdDSA for online mint message signing.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
+};
+
+
+/**
+ * Type of online public keys used by the mint to
+ * sign messages.
+ */
+struct TALER_MintPrivateKey
+{
+ /**
+ * Taler uses EdDSA for online signatures sessions.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
+ * Type of signatures used by the mint to sign messages online.
+ */
+struct TALER_MintSignature
+{
+ /**
+ * Taler uses EdDSA for online signatures sessions.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature eddsa_signature;
+};
+
+
+/**
+ * Type of the offline master public key used by the mint.
+ */
+struct TALER_MasterPublicKey
+{
+ /**
+ * Taler uses EdDSA for the long-term offline master key.
+ */
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
+};
+
+
+/**
+ * Type of the offline master public keys used by the mint.
+ */
+struct TALER_MasterPrivateKey
+{
+ /**
+ * Taler uses EdDSA for the long-term offline master key.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
+ * Type of signatures by the offline master public key used by the mint.
+ */
+struct TALER_MasterSignature
+{
+ /**
+ * Taler uses EdDSA for the long-term offline master key.
+ */
+ struct GNUNET_CRYPTO_EddsaSignature eddsa_signature;
+};
+
+
+
+/**
+ * Type of public keys for Taler coins.
+ */
+struct TALER_CoinSpendPublicKey
+{
+ /**
+ * Taler uses ECDSA for coins.
+ */
+ struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_pub;
+};
+
+
+/**
+ * Type of private keys for Taler coins.
+ */
+struct TALER_CoinSpendPrivateKey
+{
+ /**
+ * Taler uses ECDSA for coins.
+ */
+ struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_priv;
+};
+
+
+/**
+ * Type of signatures made with Taler coins.
+ */
+struct TALER_CoinSpendSignature
+{
+ /**
+ * Taler uses ECDSA for coins.
+ */
+ struct GNUNET_CRYPTO_EcdsaSignature ecdsa_signature;
+};
+
+
+/**
+ * Type of blinding keys for Taler.
+ */
+struct TALER_DenominationBlindingKey
+{
+ /**
+ * Taler uses RSA for blinding.
+ */
+ struct GNUNET_CRYPTO_rsa_BlindingKey *rsa_blinding_key;
+};
+
+
+/**
+ * Type of (unblinded) coin signatures for Taler.
+ */
+struct TALER_DenominationSignature
+{
+ /**
+ * Taler uses RSA for blinding.
+ */
+ struct GNUNET_CRYPTO_rsa_Signature *rsa_signature;
+};
+
+
+/**
+ * Type of public signing keys for verifying blindly signed coins.
+ */
+struct TALER_DenominationPublicKey
+{
+ /**
+ * Taler uses RSA for signing coins.
+ */
+ struct GNUNET_CRYPTO_rsa_PublicKey *rsa_public_key;
+};
+
+
+/**
+ * Type of private signing keys for blind signing of coins.
+ */
+struct TALER_DenominationPrivateKey
+{
+ /**
+ * Taler uses RSA for signing coins.
+ */
+ struct GNUNET_CRYPTO_rsa_PrivateKey *rsa_private_key;
+};
+
+
+/**
* Public information about a coin (including the public key
* of the coin, the denomination key and the signature with
* the denomination key).
@@ -37,19 +327,19 @@ struct TALER_CoinPublicInfo
/**
* The coin's public key.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub;
+ struct TALER_CoinSpendPublicKey coin_pub;
/**
* Public key representing the denomination of the coin
* that is being deposited.
*/
- struct GNUNET_CRYPTO_rsa_PublicKey *denom_pub;
+ struct TALER_DenominationPublicKey denom_pub;
/**
* (Unblinded) signature over @e coin_pub with @e denom_pub,
* which demonstrates that the coin is valid.
*/
- struct GNUNET_CRYPTO_rsa_Signature *denom_sig;
+ struct TALER_DenominationSignature denom_sig;
};
@@ -126,7 +416,7 @@ struct TALER_RefreshLinkEncrypted
/**
* Encrypted private key of the coin.
*/
- char coin_priv_enc[sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)];
+ char coin_priv_enc[sizeof (struct TALER_CoinSpendPrivateKey)];
};
@@ -140,12 +430,12 @@ struct TALER_RefreshLinkDecrypted
/**
* Private key of the coin.
*/
- struct GNUNET_CRYPTO_EcdsaPrivateKey coin_priv;
+ struct TALER_CoinSpendPrivateKey coin_priv;
/**
- * Blinding key with @e blinding_key_enc_size bytes.
+ * Blinding key.
*/
- struct GNUNET_CRYPTO_rsa_BlindingKey *blinding_key;
+ struct TALER_DenominationBlindingKey blinding_key;
};
diff --git a/src/include/taler_mint_service.h b/src/include/taler_mint_service.h
index f300a5cfb..30aaad38e 100644
--- a/src/include/taler_mint_service.h
+++ b/src/include/taler_mint_service.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors)
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -42,7 +42,7 @@ struct TALER_MINT_SigningPublicKey
/**
* The signing public key
*/
- struct GNUNET_CRYPTO_EddsaPublicKey key;
+ struct TALER_MintPublicKey key;
/**
* Validity start time
@@ -64,7 +64,7 @@ struct TALER_MINT_DenomPublicKey
/**
* The public key
*/
- struct GNUNET_CRYPTO_rsa_PublicKey *key;
+ struct TALER_DenominationPublicKey key;
/**
* Timestamp indicating when the denomination key becomes valid
@@ -132,7 +132,7 @@ TALER_MINT_cleanup (struct TALER_MINT_Context *ctx);
* @param hostname the hostname of the mint
* @param port the point where the mint's HTTP service is running. If port is
* given as 0, ports 80 or 443 are chosen depending on @a url.
- * @param mint_key the public key of the mint. This is used to verify the
+ * @param master_key the public master key of the mint. This is used to verify the
* responses of the mint.
* @return the mint handle; NULL upon error
*/
@@ -140,7 +140,7 @@ struct TALER_MINT_Handle *
TALER_MINT_connect (struct TALER_MINT_Context *ctx,
const char *hostname,
uint16_t port,
- struct GNUNET_CRYPTO_EddsaPublicKey *mint_key);
+ const struct TALER_MasterPublicKey *master_key);
/**
* Disconnect from the mint
@@ -282,15 +282,15 @@ struct TALER_MINT_DepositHandle *
TALER_MINT_deposit_submit_json_ (struct TALER_MINT_Handle *mint,
TALER_MINT_DepositResultCallback *cb,
void *cls,
- struct GNUNET_CRYPTO_EddsaPublicKey *coin_pub,
- struct TALER_BLIND_SigningPublicKey *denom_pub,
+ const struct TALER_CoinPublicKey *coin_pub,
+ const struct TALER_BLIND_SigningPublicKey *denom_pub,
struct TALER_BLIND_Signature *ubsig,
uint64_t transaction_id,
struct TALER_Amount *amount,
- struct GNUNET_CRYPTO_EddsaPublicKey *merchant_pub,
- struct GNUNET_HashCode *h_contract,
- struct GNUNET_HashCode *h_wire,
- struct GNUNET_CRYPTO_EddsaSignature *csig,
+ const struct TALER_MerchantPublicKey *merchant_pub,
+ const struct GNUNET_HashCode *h_contract,
+ const struct GNUNET_HashCode *h_wire,
+ const struct TALER_CoinSignature *csig,
json_t *wire_obj);
#endif
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 4566764d0..51134bf26 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors)
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -28,7 +28,6 @@
#ifndef TALER_SIGNATURES_H
#define TALER_SIGNATURES_H
-#include <gnunet/gnunet_util_lib.h>
#include "taler_util.h"
/**
@@ -129,7 +128,7 @@ struct TALER_WithdrawRequest
* Reserve public key (which reserve to withdraw from). This is
* the public key which must match the signature.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey reserve_pub;
+ struct TALER_ReservePublicKey reserve_pub;
/**
* Value of the coin being minted (matching the denomination key)
@@ -189,7 +188,7 @@ struct TALER_DepositRequest
/**
* The coin's public key.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub;
+ struct TALER_CoinSpendPublicKey coin_pub;
};
@@ -232,12 +231,12 @@ struct TALER_DepositConfirmation
/**
* The coin's public key.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub;
+ struct TALER_CoinSpendPublicKey coin_pub;
/**
* The Merchant's public key.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey merchant;
+ struct TALER_MerchantPublicKey merchant;
};
@@ -274,7 +273,7 @@ struct RefreshMeltCoinSignature
/**
* The coin's public key.
*/
- struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub;
+ struct TALER_CoinSpendPublicKey coin_pub;
};
@@ -298,7 +297,7 @@ struct RefreshMeltSessionSignature
* Public key of the refresh session for which
* @e melt_client_signature must be a valid signature.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey session_key;
+ struct TALER_SessionPublicKey session_key;
/**
* What is the total value of the coins created during the
@@ -348,10 +347,12 @@ struct RefreshMeltConfirmSignRequestBody
*/
struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ // FIXME: We probably need more info in here...
+
/**
- * FIXME.
+ * Public key the client uses for this session.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey session_pub;
+ struct TALER_SessionPublicKey session_pub;
};
@@ -365,7 +366,7 @@ struct TALER_MINT_SignKeyIssue
/**
* Signature over the signing key (by the master key of the mint).
*/
- struct GNUNET_CRYPTO_EddsaSignature signature;
+ struct TALER_MasterSignature signature;
/**
* Purpose is #TALER_SIGNATURE_MASTER_SIGNKEY.
@@ -376,7 +377,7 @@ struct TALER_MINT_SignKeyIssue
* Master public key of the mint corresponding to @e signature.
* This is the long-term offline master key of the mint.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey master_pub;
+ struct TALER_MasterPublicKey master_pub;
/**
* When does this signing key begin to be valid?
@@ -395,7 +396,7 @@ struct TALER_MINT_SignKeyIssue
* The public online signing key that the mint will use
* between @e start and @e expire.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey signkey_pub;
+ struct TALER_MintPublicKey signkey_pub;
};
@@ -409,7 +410,7 @@ struct TALER_MINT_DenomKeyIssue
* Signature over this struct to affirm the validity
* of the key.
*/
- struct GNUNET_CRYPTO_EddsaSignature signature;
+ struct TALER_MasterSignature signature;
/**
* Purpose ist #TALER_SIGNATURE_MASTER_DENOM.
@@ -420,7 +421,7 @@ struct TALER_MINT_DenomKeyIssue
* The long-term offline master key of the mint that was
* used to create @e signature.
*/
- struct GNUNET_CRYPTO_EddsaPublicKey master;
+ struct TALER_MasterPublicKey master;
/**
* Start time of the validity period for this key.