Example #1
0
  LB - Dec 2013 - revised to include compiler define options
*/


typedef struct {
    const char *name;
    const unsigned int size;
} crypt_size;

#define _SZ_STRINGIFY_S(s) { #s, sizeof(struct s) }
#define _SZ_STRINGIFY_T(s) { #s, sizeof(s) }

static const crypt_size _crypt_sizes[] = {
    /* hash state sizes */
    _SZ_STRINGIFY_S(ltc_hash_descriptor),
    _SZ_STRINGIFY_T(hash_state),
#ifdef LTC_CHC_HASH
    _SZ_STRINGIFY_S(chc_state),
#endif
#ifdef LTC_WHIRLPOOL
    _SZ_STRINGIFY_S(whirlpool_state),
#endif
#ifdef LTC_SHA3
    _SZ_STRINGIFY_S(sha3_state),
#endif
#ifdef LTC_SHA512
    _SZ_STRINGIFY_S(sha512_state),
#endif
#ifdef LTC_SHA256
    _SZ_STRINGIFY_S(sha256_state),
#endif
Example #2
0
  LB - Dec 2013 - revised to include compiler define options
*/


typedef struct {
    const char *name;
    const unsigned int size;
} crypt_size;

#define _SZ_STRINGIFY_S(s) { #s, sizeof(struct s) }
#define _SZ_STRINGIFY_T(s) { #s, sizeof(s) }

static const crypt_size _crypt_sizes[] = {
    // hash state sizes
    _SZ_STRINGIFY_S(ltc_hash_descriptor),
    _SZ_STRINGIFY_T(hash_state),
#ifdef LTC_SHA256
    _SZ_STRINGIFY_S(sha256_state),
#endif
#ifdef LTC_SHA512
    _SZ_STRINGIFY_S(sha512_state),
#endif
#ifdef LTC_WHIRLPOOL
    _SZ_STRINGIFY_S(whirlpool_state),
#endif
#ifdef LTC_MD2
    _SZ_STRINGIFY_S(md2_state),
#endif
#ifdef LTC_MD4
    _SZ_STRINGIFY_S(md4_state),
#endif