Define uint128_t only once in private/common.h
This commit is contained in:
parent
58fc2dcf5b
commit
3d374fe8a9
@ -25,14 +25,6 @@
|
||||
#include "runtime.h"
|
||||
#include "utils.h"
|
||||
|
||||
#ifdef HAVE_TI_MODE
|
||||
# if defined(__SIZEOF_INT128__)
|
||||
typedef unsigned __int128 uint128_t;
|
||||
# else
|
||||
typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static blake2b_compress_fn blake2b_compress = blake2b_compress_ref;
|
||||
|
||||
static const uint64_t blake2b_IV[8] = {
|
||||
|
@ -3,11 +3,7 @@
|
||||
and 128 bit addition
|
||||
*/
|
||||
|
||||
#if defined(__SIZEOF_INT128__)
|
||||
typedef unsigned __int128 uint128_t;
|
||||
#else
|
||||
typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
#endif
|
||||
#include "private/common.h"
|
||||
|
||||
#define MUL(out, x, y) out = ((uint128_t) x * y)
|
||||
#define ADD(out, in) out += in
|
||||
@ -23,8 +19,6 @@ typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
# define POLY1305_NOINLINE
|
||||
#endif
|
||||
|
||||
#include "private/common.h"
|
||||
|
||||
#define poly1305_block_size 16
|
||||
|
||||
/* 17 + sizeof(unsigned long long) + 8*sizeof(unsigned long long) */
|
||||
|
@ -19,12 +19,6 @@
|
||||
|
||||
typedef __m128i xmmi;
|
||||
|
||||
# if defined(__SIZEOF_INT128__)
|
||||
typedef unsigned __int128 uint128_t;
|
||||
# else
|
||||
typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
# endif
|
||||
|
||||
# if defined(_MSC_VER)
|
||||
# define POLY1305_NOINLINE __declspec(noinline)
|
||||
# elif defined(__GNUC__)
|
||||
|
@ -29,13 +29,12 @@
|
||||
|
||||
#include "../scalarmult_curve25519.h"
|
||||
#include "curve25519_donna_c64.h"
|
||||
#include "private/common.h"
|
||||
#include "utils.h"
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint64_t limb;
|
||||
typedef limb felem[5];
|
||||
/* Special gcc mode for 128-bit integers */
|
||||
typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
|
||||
/* Sum two numbers: output += in */
|
||||
static inline void
|
||||
|
@ -7,6 +7,14 @@
|
||||
|
||||
#define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1])
|
||||
|
||||
#ifdef HAVE_TI_MODE
|
||||
# if defined(__SIZEOF_INT128__)
|
||||
typedef unsigned __int128 uint128_t;
|
||||
# else
|
||||
typedef unsigned uint128_t __attribute__((mode(TI)));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define ROTL32(X, B) rotl32((X), (B))
|
||||
static inline uint32_t
|
||||
rotl32(const uint32_t x, const int b)
|
||||
|
Loading…
Reference in New Issue
Block a user