diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-30 13:49:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-30 13:49:29 +0100 |
commit | a396f4e7fa39f17aec35360eb12098629649c831 (patch) | |
tree | e3e94b05bd85f548e52859af50660e5aea44d456 /src/include/taler_crypto_lib.h | |
parent | 3bb757b3a7bddbd132805dc1147158b40238e543 (diff) | |
parent | ae45b7ac9579cc9fcb9c3008162e07b694eb52f8 (diff) | |
download | exchange-a396f4e7fa39f17aec35360eb12098629649c831.tar.gz exchange-a396f4e7fa39f17aec35360eb12098629649c831.tar.bz2 exchange-a396f4e7fa39f17aec35360eb12098629649c831.zip |
Merge branch 'master' of ssh://taler.net:/var/git/mint
Diffstat (limited to 'src/include/taler_crypto_lib.h')
-rw-r--r-- | src/include/taler_crypto_lib.h | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 16240e5a3..6056270fa 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) + Copyright (C) 2014, 2015 GNUnet e.V. 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 @@ -428,6 +428,61 @@ struct TALER_RefreshLinkDecrypted }; +/** + * Length of the raw value in the Taler wire transfer identifier + * (in binary representation). + */ +#define TALER_WIRE_TRANSFER_IDENTIFIER_LEN 32 + +/** + * #TALER_WIRE_TRANSFER_IDENTIFIER_LEN as a string. + */ +#define TALER_WIRE_TRANSFER_IDENTIFIER_LEN_STR "32" + +/** + * Raw value of a wire transfer subjects, without the checksum. + */ +struct TALER_WireTransferIdentifierRawP +{ + + /** + * Raw value. Note that typical payment systems (SEPA, ACH) support + * at least two lines of 27 ASCII characters to encode a transaction + * subject or "details", for a total of 54 characters. (The payment + * system protocols often support more lines, but the forms presented + * to customers are usually limited to 54 characters.) + * + * With a Base32-encoding of 5 bit per character, this gives us 270 + * bits or (rounded down) 33 bytes. So we use the first 32 bytes to + * encode the actual value (i.e. a 256-bit / 32-byte public key or + * a hash code), and the last byte for a minimalistic checksum. + */ + uint8_t raw[TALER_WIRE_TRANSFER_IDENTIFIER_LEN]; +}; + + +/** + * Binary information encoded in Crockford's Base32 in wire transfer + * subjects of transfers from Taler to a merchant. The actual value + * is chosen by the mint and has no particular semantics, other than + * being unique so that the mint can lookup details about the wire + * transfer when needed. + */ +struct TALER_WireTransferIdentifierP +{ + + /** + * Raw value. + */ + struct TALER_WireTransferIdentifierRawP raw; + + /** + * Checksum using CRC8 over the @e raw data. + */ + uint8_t crc8; +}; + + GNUNET_NETWORK_STRUCT_END |