• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2    BLAKE2 reference source code package - optimized C implementations
3 
4    Copyright 2012, Samuel Neves <sneves@dei.uc.pt>.  You may use this under the
5    terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
6    your option.  The terms of these licenses can be found at:
7 
8    - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
9    - OpenSSL license   : https://www.openssl.org/source/license.html
10    - Apache 2.0        : http://www.apache.org/licenses/LICENSE-2.0
11 
12    More information about the BLAKE2 hash function can be found at
13    https://blake2.net.
14 */
15 #pragma once
16 #ifndef __BLAKE2_CONFIG_H__
17 #define __BLAKE2_CONFIG_H__
18 
19 /* These don't work everywhere */
20 #if defined(__SSE2__) || defined(__x86_64__) || defined(__amd64__)
21 #define HAVE_SSE2
22 #endif
23 
24 #if defined(__SSSE3__)
25 #define HAVE_SSSE3
26 #endif
27 
28 #if defined(__SSE4_1__)
29 #define HAVE_SSE41
30 #endif
31 
32 #if defined(__AVX__)
33 #define HAVE_AVX
34 #endif
35 
36 #if defined(__XOP__)
37 #define HAVE_XOP
38 #endif
39 
40 
41 #ifdef HAVE_AVX2
42 #ifndef HAVE_AVX
43 #define HAVE_AVX
44 #endif
45 #endif
46 
47 #ifdef HAVE_XOP
48 #ifndef HAVE_AVX
49 #define HAVE_AVX
50 #endif
51 #endif
52 
53 #ifdef HAVE_AVX
54 #ifndef HAVE_SSE41
55 #define HAVE_SSE41
56 #endif
57 #endif
58 
59 #ifdef HAVE_SSE41
60 #ifndef HAVE_SSSE3
61 #define HAVE_SSSE3
62 #endif
63 #endif
64 
65 #ifdef HAVE_SSSE3
66 #define HAVE_SSE2
67 #endif
68 
69 #if !defined(HAVE_SSE2)
70 #error "This code requires at least SSE2."
71 #endif
72 
73 #endif
74 
75