1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */ 2 /* SPDX-License-Identifier: Unlicense */ 3 4 #include "tomcrypt_private.h" 5 6 /** 7 @file crypt_register_all_hashes.c 8 9 Steffen Jaeckel 10 */ 11 12 #define REGISTER_HASH(h) do {\ 13 LTC_ARGCHK(register_hash(h) != -1); \ 14 } while(0) 15 register_all_hashes(void)16int register_all_hashes(void) 17 { 18 #ifdef LTC_TIGER 19 REGISTER_HASH(&tiger_desc); 20 #endif 21 #ifdef LTC_MD2 22 REGISTER_HASH(&md2_desc); 23 #endif 24 #ifdef LTC_MD4 25 REGISTER_HASH(&md4_desc); 26 #endif 27 #ifdef LTC_MD5 28 REGISTER_HASH(&md5_desc); 29 #endif 30 #ifdef LTC_SHA1 31 REGISTER_HASH(&sha1_desc); 32 #endif 33 #ifdef LTC_SHA224 34 REGISTER_HASH(&sha224_desc); 35 #endif 36 #ifdef LTC_SHA256 37 REGISTER_HASH(&sha256_desc); 38 #endif 39 #ifdef LTC_SHA384 40 REGISTER_HASH(&sha384_desc); 41 #endif 42 #ifdef LTC_SHA512 43 REGISTER_HASH(&sha512_desc); 44 #endif 45 #ifdef LTC_SHA512_224 46 REGISTER_HASH(&sha512_224_desc); 47 #endif 48 #ifdef LTC_SHA512_256 49 REGISTER_HASH(&sha512_256_desc); 50 #endif 51 #ifdef LTC_SHA3 52 REGISTER_HASH(&sha3_224_desc); 53 REGISTER_HASH(&sha3_256_desc); 54 REGISTER_HASH(&sha3_384_desc); 55 REGISTER_HASH(&sha3_512_desc); 56 #endif 57 #ifdef LTC_KECCAK 58 REGISTER_HASH(&keccak_224_desc); 59 REGISTER_HASH(&keccak_256_desc); 60 REGISTER_HASH(&keccak_384_desc); 61 REGISTER_HASH(&keccak_512_desc); 62 #endif 63 #ifdef LTC_RIPEMD128 64 REGISTER_HASH(&rmd128_desc); 65 #endif 66 #ifdef LTC_RIPEMD160 67 REGISTER_HASH(&rmd160_desc); 68 #endif 69 #ifdef LTC_RIPEMD256 70 REGISTER_HASH(&rmd256_desc); 71 #endif 72 #ifdef LTC_RIPEMD320 73 REGISTER_HASH(&rmd320_desc); 74 #endif 75 #ifdef LTC_WHIRLPOOL 76 REGISTER_HASH(&whirlpool_desc); 77 #endif 78 #ifdef LTC_BLAKE2S 79 REGISTER_HASH(&blake2s_128_desc); 80 REGISTER_HASH(&blake2s_160_desc); 81 REGISTER_HASH(&blake2s_224_desc); 82 REGISTER_HASH(&blake2s_256_desc); 83 #endif 84 #ifdef LTC_BLAKE2S 85 REGISTER_HASH(&blake2b_160_desc); 86 REGISTER_HASH(&blake2b_256_desc); 87 REGISTER_HASH(&blake2b_384_desc); 88 REGISTER_HASH(&blake2b_512_desc); 89 #endif 90 #ifdef LTC_CHC_HASH 91 REGISTER_HASH(&chc_desc); 92 LTC_ARGCHK(chc_register(find_cipher_any("aes", 8, 16)) == CRYPT_OK); 93 #endif 94 return CRYPT_OK; 95 } 96