2013-02-01 16:44:36 +01:00
|
|
|
/*
|
|
|
|
BLAKE2 reference source code package - optimized C implementations
|
2016-06-10 12:37:44 +02:00
|
|
|
|
2016-02-29 05:42:23 +01:00
|
|
|
Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the
|
|
|
|
terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
|
|
|
|
your option. The terms of these licenses can be found at:
|
2016-06-10 12:37:44 +02:00
|
|
|
|
2016-02-29 05:42:23 +01:00
|
|
|
- CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
|
|
|
|
- OpenSSL license : https://www.openssl.org/source/license.html
|
|
|
|
- Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
|
2016-06-10 12:37:44 +02:00
|
|
|
|
2016-02-29 05:42:23 +01:00
|
|
|
More information about the BLAKE2 hash function can be found at
|
|
|
|
https://blake2.net.
|
2013-02-01 16:44:36 +01:00
|
|
|
*/
|
2016-06-11 11:29:09 +02:00
|
|
|
#ifndef BLAKE2_CONFIG_H
|
|
|
|
#define BLAKE2_CONFIG_H
|
2013-02-01 16:44:36 +01:00
|
|
|
|
2016-04-22 12:07:57 +02:00
|
|
|
/* These don't work everywhere */
|
2016-06-10 12:37:44 +02:00
|
|
|
#if defined(__SSE2__) || defined(__x86_64__) || defined(__amd64__)
|
2013-02-01 16:44:36 +01:00
|
|
|
#define HAVE_SSE2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__SSSE3__)
|
|
|
|
#define HAVE_SSSE3
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__SSE4_1__)
|
|
|
|
#define HAVE_SSE41
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__AVX__)
|
|
|
|
#define HAVE_AVX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__XOP__)
|
|
|
|
#define HAVE_XOP
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_AVX2
|
|
|
|
#ifndef HAVE_AVX
|
|
|
|
#define HAVE_AVX
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_XOP
|
|
|
|
#ifndef HAVE_AVX
|
|
|
|
#define HAVE_AVX
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_AVX
|
|
|
|
#ifndef HAVE_SSE41
|
|
|
|
#define HAVE_SSE41
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SSE41
|
|
|
|
#ifndef HAVE_SSSE3
|
|
|
|
#define HAVE_SSSE3
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_SSSE3
|
|
|
|
#define HAVE_SSE2
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if !defined(HAVE_SSE2)
|
|
|
|
#error "This code requires at least SSE2."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|