16 #ifndef included_sha2_h
17 #define included_sha2_h
19 #include <my_config.h>
21 #if defined(HAVE_YASSL) || defined(HAVE_OPENSSL)
28 # include <openssl/sha.h>
32 #include "../extra/yassl/taocrypt/include/sha.hpp"
38 #ifndef SHA512_DIGEST_LENGTH
39 #define SHA512_DIGEST_LENGTH TaoCrypt::SHA512::DIGEST_SIZE
42 #ifndef SHA384_DIGEST_LENGTH
43 #define SHA384_DIGEST_LENGTH TaoCrypt::SHA384::DIGEST_SIZE
46 #ifndef SHA256_DIGEST_LENGTH
47 #define SHA256_DIGEST_LENGTH TaoCrypt::SHA256::DIGEST_SIZE
50 #ifndef SHA224_DIGEST_LENGTH
51 #define SHA224_DIGEST_LENGTH TaoCrypt::SHA224::DIGEST_SIZE
54 #define GEN_YASSL_SHA2_BRIDGE(size) \
55 unsigned char* SHA##size(const unsigned char *input_ptr, size_t input_length, \
56 char unsigned *output_ptr);
58 GEN_YASSL_SHA2_BRIDGE(512);
59 GEN_YASSL_SHA2_BRIDGE(384);
60 GEN_YASSL_SHA2_BRIDGE(256);
61 GEN_YASSL_SHA2_BRIDGE(224);
63 #undef GEN_YASSL_SHA2_BRIDGE