From 57d1f08dbca256f5fe16d57b29bfa523dec8f6c4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 8 Jan 2015 18:37:20 +0100 Subject: -initial import for mint --- src/include/taler_types.h | 120 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/include/taler_types.h (limited to 'src/include/taler_types.h') diff --git a/src/include/taler_types.h b/src/include/taler_types.h new file mode 100644 index 000000000..c6c2c0209 --- /dev/null +++ b/src/include/taler_types.h @@ -0,0 +1,120 @@ +/** + * @file include/types.h + * @brief This files defines the various data and message types in TALER. + * @author Sree Harsha Totakura + * @author Florian Dold + */ + +#ifndef TYPES_H_ +#define TYPES_H_ + +#include "taler_rsa.h" + + +/** + * Public information about a coin. + */ +struct TALER_CoinPublicInfo +{ + /** + * The coin's public key. + */ + struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; + + /* + * The public key signifying the coin's denomination. + */ + struct TALER_RSA_PublicKeyBinaryEncoded denom_pub; + + /** + * Signature over coin_pub by denom_pub. + */ + struct TALER_RSA_Signature denom_sig; +}; + + +/** + * 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. + */ + struct TALER_RSA_PublicKeyBinaryEncoded denomination_pub; + + /** + * Purpose containing coin's blinded public key. + */ + struct TALER_RSA_BlindedSignaturePurpose coin_envelope; +}; + + + +/** + * Data type for messages + */ +struct TALER_MessageHeader +{ + /** + * The type of the message in Network-byte order (NBO) + */ + uint16_t type; + + /** + * The size of the message in NBO + */ + uint16_t size; +}; + +/*****************/ +/* Message types */ +/*****************/ + +/** + * The message type of a blind signature + */ +#define TALER_MSG_TYPE_BLINDED_SIGNATURE 1 + +/** + * The message type of a blinded message + */ +#define TALER_MSG_TYPE_BLINDED_MESSAGE 2 + +/** + * The message type of an unblinded signature + * @FIXME: Not currently used + */ +#define TALER_MSG_TYPE_UNBLINDED_SIGNATURE 3 + +/** + * The type of a blinding residue message + * @FIXME: Not currently used + */ +#define TALER_MSG_TYPE_BLINDING_RESIDUE 4 + +/** + * The type of a message containing the blinding factor + */ +#define TALER_MSG_TYPE_BLINDING_FACTOR 5 + + +#endif /* TYPES_H_ */ + +/* end of include/types.h */ -- cgit v1.2.3