1
/* Copyright (C) 2007 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#ifndef included_sha2_h
17
#define included_sha2_h
19
#include <my_global.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
69
# endif /* HAVE_YASSL */
71
#endif /* HAVE_OPENSSL || HAVE_YASSL */
72
#endif /* included_sha2_h */