summaryrefslogtreecommitdiff
path: root/src/include/taler_crypto_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-03-22 22:14:30 +0100
committerChristian Grothoff <christian@grothoff.org>2015-03-22 22:14:30 +0100
commitf73071bc6219788fb11b534cfd4fa88b96681306 (patch)
tree4ab823744be926f3a11b0cfde8456413cbc14389 /src/include/taler_crypto_lib.h
parent6c1081f1b50770d18df998915d8d74be383ad1bf (diff)
downloadexchange-f73071bc6219788fb11b534cfd4fa88b96681306.tar.gz
exchange-f73071bc6219788fb11b534cfd4fa88b96681306.tar.bz2
exchange-f73071bc6219788fb11b534cfd4fa88b96681306.zip
fix #3638
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r--src/include/taler_crypto_lib.h304
1 files changed, 297 insertions, 7 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;
};