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