|
| 1 | +/* Copyright (C) 2007 MySQL AB |
| 2 | +
|
| 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. |
| 6 | +
|
| 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. |
| 11 | +
|
| 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 */ |
| 15 | + |
| 16 | +#ifndef included_sha2_h |
| 17 | +#define included_sha2_h |
| 18 | + |
| 19 | +#include <my_config.h> |
| 20 | + |
| 21 | +# ifndef HAVE_YASSL |
| 22 | +# include <openssl/sha.h> |
| 23 | +# endif |
| 24 | + |
| 25 | +# ifdef HAVE_YASSL |
| 26 | + |
| 27 | +#include "../extra/yassl/taocrypt/include/sha.hpp" |
| 28 | + |
| 29 | +# ifdef __cplusplus |
| 30 | +extern "C" { |
| 31 | +# endif |
| 32 | + |
| 33 | +#ifndef SHA512_DIGEST_LENGTH |
| 34 | +#define SHA512_DIGEST_LENGTH TaoCrypt::SHA512::DIGEST_SIZE |
| 35 | +#endif |
| 36 | + |
| 37 | +#ifndef SHA384_DIGEST_LENGTH |
| 38 | +#define SHA384_DIGEST_LENGTH TaoCrypt::SHA384::DIGEST_SIZE |
| 39 | +#endif |
| 40 | + |
| 41 | +#ifndef SHA256_DIGEST_LENGTH |
| 42 | +#define SHA256_DIGEST_LENGTH TaoCrypt::SHA256::DIGEST_SIZE |
| 43 | +#endif |
| 44 | + |
| 45 | +#ifndef SHA224_DIGEST_LENGTH |
| 46 | +#define SHA224_DIGEST_LENGTH TaoCrypt::SHA224::DIGEST_SIZE |
| 47 | +#endif |
| 48 | + |
| 49 | +#define GEN_YASSL_SHA2_BRIDGE(size) \ |
| 50 | +unsigned char* SHA##size(const unsigned char *input_ptr, size_t input_length, \ |
| 51 | + char unsigned *output_ptr); |
| 52 | + |
| 53 | +GEN_YASSL_SHA2_BRIDGE(512); |
| 54 | +GEN_YASSL_SHA2_BRIDGE(384); |
| 55 | +GEN_YASSL_SHA2_BRIDGE(256); |
| 56 | +GEN_YASSL_SHA2_BRIDGE(224); |
| 57 | + |
| 58 | +#undef GEN_YASSL_SHA2_BRIDGE |
| 59 | + |
| 60 | +# ifdef __cplusplus |
| 61 | +} |
| 62 | +# endif |
| 63 | + |
| 64 | +# endif /* HAVE_YASSL */ |
| 65 | + |
| 66 | +#endif /* included_sha2_h */ |
0 commit comments