diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_signatures.h | 40 | ||||
-rw-r--r-- | src/include/taler_util.h | 19 |
2 files changed, 56 insertions, 3 deletions
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 90fa421c..e72c2ed6 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -29,6 +29,7 @@ #define TALER_SIGNATURES_H #include <gnunet/gnunet_util_lib.h> +#include "taler_util.h" /** * Purpose for signing public keys signed @@ -141,6 +142,45 @@ struct TALER_WithdrawRequest }; +/** + * Format used to generate the signature on a request to deposit + * a coin into the account of a merchant. + */ +struct TALER_DepositRequest +{ + /** + * Purpose must be #TALER_SIGNATURE_DEPOSIT + */ + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + + /** + * Hash over the contract for which this deposit is made. + */ + struct GNUNET_HashCode h_contract; + + /** + * Hash over the wiring information of the merchant. + */ + struct GNUNET_HashCode h_wire; + + /** + * Merchant-generated transaction ID to detect duplicate + * transactions. + */ + uint64_t transaction_id GNUNET_PACKED; + + /** + * Amount to be deposited. + */ + struct TALER_AmountNBO amount; + + /** + * The coin's public key. + */ + struct GNUNET_CRYPTO_EcdsaPublicKey coin_pub; + +}; + /** * FIXME diff --git a/src/include/taler_util.h b/src/include/taler_util.h index 2c5faaa5..ab5ee11d 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -73,14 +73,27 @@ void TALER_gcrypt_init (void); +/** + * Load configuration by parsing all configuration + * files in the given directory. + * + * @param base_dir directory with the configuration files + * @return NULL on error, otherwise configuration + */ +struct GNUNET_CONFIGURATION_Handle * +TALER_config_load (const char *base_dir); + + + /* *********************** Amount management ****************** */ /** * Number of characters (plus 1 for 0-termination) we use to - * represent currency names (i.e. EUR, USD, etc.). + * represent currency names (i.e. EUR, USD, etc.). We use + * 8 for alignment (!). */ -#define TALER_CURRENCY_LEN 4 +#define TALER_CURRENCY_LEN 8 GNUNET_NETWORK_STRUCT_BEGIN @@ -127,7 +140,7 @@ struct TALER_Amount /** * Currency string, left adjusted and padded with zeros. */ - char currency[4]; + char currency[TALER_CURRENCY_LEN]; }; |