1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #ifndef OSSL_CRYPTO_EC_CURVE448UTILS_H
- # define OSSL_CRYPTO_EC_CURVE448UTILS_H
- # include <openssl/e_os2.h>
- # ifndef C448_WORD_BITS
- # if (defined(__SIZEOF_INT128__) && (__SIZEOF_INT128__ == 16)) \
- && !defined(__sparc__) \
- && (!defined(__SIZEOF_LONG__) || (__SIZEOF_LONG__ == 8))
- # define C448_WORD_BITS 64
- # else
- # define C448_WORD_BITS 32
- # endif
- # endif
- # if C448_WORD_BITS == 64
- typedef uint64_t c448_word_t;
- typedef int64_t c448_sword_t;
- typedef uint64_t c448_bool_t;
- typedef __uint128_t c448_dword_t;
- typedef __int128_t c448_dsword_t;
- # elif C448_WORD_BITS == 32
- typedef uint32_t c448_word_t;
- typedef int32_t c448_sword_t;
- typedef uint32_t c448_bool_t;
- typedef uint64_t c448_dword_t;
- typedef int64_t c448_dsword_t;
- # else
- # error "Only supporting C448_WORD_BITS = 32 or 64 for now"
- # endif
- # define C448_TRUE (0 - (c448_bool_t)1)
- # define C448_FALSE 0
- typedef enum {
- C448_SUCCESS = -1,
- C448_FAILURE = 0
- } c448_error_t;
- static ossl_inline c448_error_t c448_succeed_if(c448_bool_t x)
- {
- return (c448_error_t) x;
- }
- #endif
|