3 * This file is distributed under the same license as OpenSSL
6 #ifndef GOST_GRASSHOPPER_DEFINES_H
7 #define GOST_GRASSHOPPER_DEFINES_H
9 #if defined(__cplusplus)
16 # if !defined(inline) && !defined(__cplusplus)
17 # if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
18 # define GRASSHOPPER_INLINE inline
19 # elif defined(__GNUC__) && __GNUC__ >= 2
20 # define GRASSHOPPER_INLINE __inline__
21 # define likely(x) __builtin_expect(!!(x), 1)
22 # elif defined(_MSC_VER)
23 # define GRASSHOPPER_INLINE __inline
25 # define GRASSHOPPER_INLINE
28 # define GRASSHOPPER_INLINE inline
47 grasshopper_w128_t k[2];
54 #define GRASSHOPPER_ROUND_KEYS_COUNT 10
57 grasshopper_w128_t k[GRASSHOPPER_ROUND_KEYS_COUNT];
58 } grasshopper_round_keys_t;
60 extern const uint8_t grasshopper_pi[0x100];
62 extern const uint8_t grasshopper_pi_inv[0x100];
64 extern const uint8_t grasshopper_lvec[16];
66 #define GRASSHOPPER_BLOCK_SIZE (128/8)
67 #define GRASSHOPPER_KEY_SIZE (256/8)
69 #if defined(__cplusplus)