Skip to content

Commit 3fe4994

Browse files
committed
- Simplifies downstream integration
- Convert CRLF to LF - Improve stack-efficient option
1 parent 11ff0f0 commit 3fe4994

File tree

14 files changed

+202
-166
lines changed

14 files changed

+202
-166
lines changed

META/MAYO-1_META.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ implementations:
1515
- name: opt
1616
version: round2
1717
folder_name: .
18-
compile_opts: -DMAYO_VARIANT=MAYO_1 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL
18+
compile_opts: -DMAYO_VARIANT=MAYO_1 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL -DHAVE_STACKEFFICIENT
1919
signature_keypair: pqmayo_MAYO_1_opt_crypto_sign_keypair
2020
signature_signature: pqmayo_MAYO_1_opt_crypto_sign_signature
2121
signature_verify: pqmayo_MAYO_1_opt_crypto_sign_verify
@@ -27,7 +27,7 @@ implementations:
2727
signature_keypair: pqmayo_MAYO_1_avx2_crypto_sign_keypair
2828
signature_signature: pqmayo_MAYO_1_avx2_crypto_sign_signature
2929
signature_verify: pqmayo_MAYO_1_avx2_crypto_sign_verify
30-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_1/api.h ./src/mayo_1/api.c
30+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_1/api.h ./src/mayo_1/api.c
3131
supported_platforms:
3232
- architecture: x86_64
3333
operating_systems:
@@ -42,7 +42,7 @@ implementations:
4242
signature_keypair: pqmayo_MAYO_1_neon_crypto_sign_keypair
4343
signature_signature: pqmayo_MAYO_1_neon_crypto_sign_signature
4444
signature_verify: pqmayo_MAYO_1_neon_crypto_sign_verify
45-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_1/api.h ./src/mayo_1/api.c
45+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_1/api.h ./src/mayo_1/api.c
4646
supported_platforms:
4747
- architecture: arm_8
4848
operating_systems:

META/MAYO-2_META.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ implementations:
2727
signature_keypair: pqmayo_MAYO_2_avx2_crypto_sign_keypair
2828
signature_signature: pqmayo_MAYO_2_avx2_crypto_sign_signature
2929
signature_verify: pqmayo_MAYO_2_avx2_crypto_sign_verify
30-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_2/api.h ./src/mayo_2/api.c
30+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_2/api.h ./src/mayo_2/api.c
3131
supported_platforms:
3232
- architecture: x86_64
3333
operating_systems:
@@ -42,7 +42,7 @@ implementations:
4242
signature_keypair: pqmayo_MAYO_2_neon_crypto_sign_keypair
4343
signature_signature: pqmayo_MAYO_2_neon_crypto_sign_signature
4444
signature_verify: pqmayo_MAYO_2_neon_crypto_sign_verify
45-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_2/api.h ./src/mayo_2/api.c
45+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_2/api.h ./src/mayo_2/api.c
4646
supported_platforms:
4747
- architecture: arm_8
4848
operating_systems:

META/MAYO-3_META.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ implementations:
1515
- name: opt
1616
version: round2
1717
folder_name: .
18-
compile_opts: -DMAYO_VARIANT=MAYO_3 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL
18+
compile_opts: -DMAYO_VARIANT=MAYO_3 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL -DHAVE_STACKEFFICIENT
1919
signature_keypair: pqmayo_MAYO_3_opt_crypto_sign_keypair
2020
signature_signature: pqmayo_MAYO_3_opt_crypto_sign_signature
2121
signature_verify: pqmayo_MAYO_3_opt_crypto_sign_verify
@@ -27,7 +27,7 @@ implementations:
2727
signature_keypair: pqmayo_MAYO_3_avx2_crypto_sign_keypair
2828
signature_signature: pqmayo_MAYO_3_avx2_crypto_sign_signature
2929
signature_verify: pqmayo_MAYO_3_avx2_crypto_sign_verify
30-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_3/api.h ./src/mayo_3/api.c
30+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_3/api.h ./src/mayo_3/api.c
3131
supported_platforms:
3232
- architecture: x86_64
3333
operating_systems:
@@ -42,7 +42,7 @@ implementations:
4242
signature_keypair: pqmayo_MAYO_3_neon_crypto_sign_keypair
4343
signature_signature: pqmayo_MAYO_3_neon_crypto_sign_signature
4444
signature_verify: pqmayo_MAYO_3_neon_crypto_sign_verify
45-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_3/api.h ./src/mayo_3/api.c
45+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_3/api.h ./src/mayo_3/api.c
4646
supported_platforms:
4747
- architecture: arm_8
4848
operating_systems:

META/MAYO-5_META.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ implementations:
1515
- name: opt
1616
version: round2
1717
folder_name: .
18-
compile_opts: -DMAYO_VARIANT=MAYO_5 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL
18+
compile_opts: -DMAYO_VARIANT=MAYO_5 -DMAYO_BUILD_TYPE_OPT -DHAVE_RANDOMBYTES_NORETVAL -DHAVE_STACKEFFICIENT
1919
signature_keypair: pqmayo_MAYO_5_opt_crypto_sign_keypair
2020
signature_signature: pqmayo_MAYO_5_opt_crypto_sign_signature
2121
signature_verify: pqmayo_MAYO_5_opt_crypto_sign_verify
@@ -27,7 +27,7 @@ implementations:
2727
signature_keypair: pqmayo_MAYO_5_avx2_crypto_sign_keypair
2828
signature_signature: pqmayo_MAYO_5_avx2_crypto_sign_signature
2929
signature_verify: pqmayo_MAYO_5_avx2_crypto_sign_verify
30-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_5/api.h ./src/mayo_5/api.c
30+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/AVX2/arithmetic_common.h ./src/AVX2/echelon_form.h ./src/AVX2/echelon_form_loop.h ./src/AVX2/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_5/api.h ./src/mayo_5/api.c
3131
supported_platforms:
3232
- architecture: x86_64
3333
operating_systems:
@@ -42,7 +42,7 @@ implementations:
4242
signature_keypair: pqmayo_MAYO_5_neon_crypto_sign_keypair
4343
signature_signature: pqmayo_MAYO_5_neon_crypto_sign_signature
4444
signature_verify: pqmayo_MAYO_5_neon_crypto_sign_verify
45-
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_5/api.h ./src/mayo_5/api.c
45+
sources: LICENSE NOTICE ./src/arithmetic.c ./src/arithmetic.h ./src/mayo.c ./src/params.c ./src/simple_arithmetic.h ./src/generic/arithmetic_fixed.h ./src/neon/arithmetic_common.h ./src/neon/echelon_form.h ./src/neon/echelon_form_loop.h ./src/neon/shuffle_arithmetic.h ./include/mayo.h ./include/mem.h ./src/common/aes_ctr.h ./src/mayo_5/api.h ./src/mayo_5/api.c
4646
supported_platforms:
4747
- architecture: arm_8
4848
operating_systems:

include/mem.h

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -5,78 +5,6 @@
55
#include <stddef.h>
66
#include <stdint.h>
77

8-
#if defined(__GNUC__) || defined(__clang__)
9-
#define BSWAP32(i) __builtin_bswap32((i))
10-
#define BSWAP64(i) __builtin_bswap64((i))
11-
#else
12-
#define BSWAP32(i) ((((i) >> 24) & 0xff) | (((i) >> 8) & 0xff00) | (((i) & 0xff00) << 8) | ((i) << 24))
13-
#define BSWAP64(i) ((BSWAP32((i) >> 32) & 0xffffffff) | (BSWAP32(i) << 32))
14-
#endif
15-
16-
extern volatile uint32_t uint32_t_blocker;
17-
extern volatile uint64_t uint64_t_blocker;
18-
extern volatile unsigned char unsigned_char_blocker;
19-
20-
#if !(((!defined(__clang__) && defined(__GNUC__) && __GNUC__ <= 12)) && (defined(__x86_64__) || defined(_M_X64)))
21-
// a > b -> b - a is negative
22-
// returns 0xFFFFFFFF if true, 0x00000000 if false
23-
static inline uint32_t ct_is_greater_than(int a, int b) {
24-
int32_t diff = b - a;
25-
return ((uint32_t) (diff >> (8*sizeof(uint32_t)-1)) ^ uint32_t_blocker);
26-
}
27-
28-
// a > b -> b - a is negative
29-
// returns 0xFFFFFFFF if true, 0x00000000 if false
30-
static inline uint64_t ct_64_is_greater_than(int a, int b) {
31-
int64_t diff = ((int64_t) b) - ((int64_t) a);
32-
return ((uint64_t) (diff >> (8*sizeof(uint64_t)-1)) ^ uint64_t_blocker);
33-
}
34-
35-
// if a == b -> 0x00000000, else 0xFFFFFFFF
36-
static inline uint32_t ct_compare_32(int a, int b) {
37-
return ((uint32_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)) ^ uint32_t_blocker);
38-
}
39-
40-
// if a == b -> 0x0000000000000000, else 0xFFFFFFFFFFFFFFFF
41-
static inline uint64_t ct_compare_64(int a, int b) {
42-
return ((uint64_t)((-(int64_t)(a ^ b)) >> (8*sizeof(uint64_t)-1)) ^ uint64_t_blocker);
43-
}
44-
45-
// if a == b -> 0x00, else 0xFF
46-
static inline unsigned char ct_compare_8(unsigned char a, unsigned char b) {
47-
return ((int8_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)) ^ unsigned_char_blocker);
48-
}
49-
#else
50-
// a > b -> b - a is negative
51-
// returns 0xFFFFFFFF if true, 0x00000000 if false
52-
static inline uint32_t ct_is_greater_than(int a, int b) {
53-
int32_t diff = b - a;
54-
return ((uint32_t) (diff >> (8*sizeof(uint32_t)-1)));
55-
}
56-
57-
// a > b -> b - a is negative
58-
// returns 0xFFFFFFFF if true, 0x00000000 if false
59-
static inline uint64_t ct_64_is_greater_than(int a, int b) {
60-
int64_t diff = ((int64_t) b) - ((int64_t) a);
61-
return ((uint64_t) (diff >> (8*sizeof(uint64_t)-1)));
62-
}
63-
64-
// if a == b -> 0x00000000, else 0xFFFFFFFF
65-
static inline uint32_t ct_compare_32(int a, int b) {
66-
return ((uint32_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)));
67-
}
68-
69-
// if a == b -> 0x0000000000000000, else 0xFFFFFFFFFFFFFFFF
70-
static inline uint64_t ct_compare_64(int a, int b) {
71-
return ((uint64_t)((-(int64_t)(a ^ b)) >> (8*sizeof(uint64_t)-1)));
72-
}
73-
74-
// if a == b -> 0x00, else 0xFF
75-
static inline unsigned char ct_compare_8(unsigned char a, unsigned char b) {
76-
return ((int8_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)));
77-
}
78-
#endif
79-
808
/**
819
* Clears and frees allocated memory.
8210
*

src/AVX2/shuffle_arithmetic.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,10 @@ void compute_P3(const mayo_params_t* p, const uint64_t* P1, uint64_t *P2, const
400400
// [ P3*S2 = P2 ]
401401
static inline void m_calculate_PS_SPS(const mayo_params_t *p, const uint64_t *P1, const uint64_t *P2, const uint64_t *P3, const unsigned char *S,
402402
uint64_t *SPS) {
403-
const int o = PARAM_o(p);
404-
const int v = PARAM_v(p);
405-
const int k = PARAM_k(p);
403+
(void) p;
404+
const int o = PARAM_NAME(o);
405+
const int v = PARAM_NAME(v);
406+
const int k = PARAM_NAME(k);
406407
const int n = o + v;
407408
/* Old approach which is constant time but doesn't have to be */
408409
unsigned char S1[V_MAX*K_MAX]; // == N-O, K

src/arithmetic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,7 @@ int sample_solution(const mayo_params_t *p, unsigned char *A,
122122
}
123123
return 1;
124124
}
125+
126+
volatile uint32_t uint32_t_blocker = 0;
127+
volatile uint64_t uint64_t_blocker = 0;
128+
volatile unsigned char unsigned_char_blocker = 0;

src/arithmetic.h

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,73 @@
1515
#endif
1616
#endif
1717

18+
#define uint32_t_blocker MAYO_NAMESPACE(uint32_t_blocker)
19+
extern volatile uint32_t uint32_t_blocker;
20+
#define uint64_t_blocker MAYO_NAMESPACE(uint64_t_blocker)
21+
extern volatile uint64_t uint64_t_blocker;
22+
#define unsigned_char_blocker MAYO_NAMESPACE(unsigned_char_blocker)
23+
extern volatile unsigned char unsigned_char_blocker;
24+
25+
#if !(((!defined(__clang__) && defined(__GNUC__) && __GNUC__ <= 12)) && (defined(__x86_64__) || defined(_M_X64)))
26+
// a > b -> b - a is negative
27+
// returns 0xFFFFFFFF if true, 0x00000000 if false
28+
static inline uint32_t ct_is_greater_than(int a, int b) {
29+
int32_t diff = b - a;
30+
return ((uint32_t) (diff >> (8*sizeof(uint32_t)-1)) ^ uint32_t_blocker);
31+
}
32+
33+
// a > b -> b - a is negative
34+
// returns 0xFFFFFFFF if true, 0x00000000 if false
35+
static inline uint64_t ct_64_is_greater_than(int a, int b) {
36+
int64_t diff = ((int64_t) b) - ((int64_t) a);
37+
return ((uint64_t) (diff >> (8*sizeof(uint64_t)-1)) ^ uint64_t_blocker);
38+
}
39+
40+
// if a == b -> 0x00000000, else 0xFFFFFFFF
41+
static inline uint32_t ct_compare_32(int a, int b) {
42+
return ((uint32_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)) ^ uint32_t_blocker);
43+
}
44+
45+
// if a == b -> 0x0000000000000000, else 0xFFFFFFFFFFFFFFFF
46+
static inline uint64_t ct_compare_64(int a, int b) {
47+
return ((uint64_t)((-(int64_t)(a ^ b)) >> (8*sizeof(uint64_t)-1)) ^ uint64_t_blocker);
48+
}
49+
50+
// if a == b -> 0x00, else 0xFF
51+
static inline unsigned char ct_compare_8(unsigned char a, unsigned char b) {
52+
return ((int8_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)) ^ unsigned_char_blocker);
53+
}
54+
#else
55+
// a > b -> b - a is negative
56+
// returns 0xFFFFFFFF if true, 0x00000000 if false
57+
static inline uint32_t ct_is_greater_than(int a, int b) {
58+
int32_t diff = b - a;
59+
return ((uint32_t) (diff >> (8*sizeof(uint32_t)-1)));
60+
}
61+
62+
// a > b -> b - a is negative
63+
// returns 0xFFFFFFFF if true, 0x00000000 if false
64+
static inline uint64_t ct_64_is_greater_than(int a, int b) {
65+
int64_t diff = ((int64_t) b) - ((int64_t) a);
66+
return ((uint64_t) (diff >> (8*sizeof(uint64_t)-1)));
67+
}
68+
69+
// if a == b -> 0x00000000, else 0xFFFFFFFF
70+
static inline uint32_t ct_compare_32(int a, int b) {
71+
return ((uint32_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)));
72+
}
73+
74+
// if a == b -> 0x0000000000000000, else 0xFFFFFFFFFFFFFFFF
75+
static inline uint64_t ct_compare_64(int a, int b) {
76+
return ((uint64_t)((-(int64_t)(a ^ b)) >> (8*sizeof(uint64_t)-1)));
77+
}
78+
79+
// if a == b -> 0x00, else 0xFF
80+
static inline unsigned char ct_compare_8(unsigned char a, unsigned char b) {
81+
return ((int8_t)((-(int32_t)(a ^ b)) >> (8*sizeof(uint32_t)-1)));
82+
}
83+
#endif
84+
1885
#if defined(MAYO_AVX) || defined(MAYO_NEON)
1986
#include <shuffle_arithmetic.h>
2087
#elif defined(MAYO_M4)
@@ -45,5 +112,13 @@ void m_upper(const mayo_params_t* p, const uint64_t *in, uint64_t *out, int size
45112
#define sample_solution MAYO_NAMESPACE(sample_solution)
46113
int sample_solution(const mayo_params_t *p, unsigned char *A, const unsigned char *y, const unsigned char *r, unsigned char *x, int k, int o, int m, int A_cols);
47114

115+
#if defined(__GNUC__) || defined(__clang__)
116+
#define BSWAP32(i) __builtin_bswap32((i))
117+
#define BSWAP64(i) __builtin_bswap64((i))
118+
#else
119+
#define BSWAP32(i) ((((i) >> 24) & 0xff) | (((i) >> 8) & 0xff00) | (((i) & 0xff00) << 8) | ((i) << 24))
120+
#define BSWAP64(i) ((BSWAP32((i) >> 32) & 0xffffffff) | (BSWAP32(i) << 32))
121+
#endif
122+
48123
#endif
49124

src/common/mem.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ void mayo_secure_clear(void *mem, size_t size) {
1717
static volatile memset_t memset_func = memset;
1818
memset_func(mem, 0, size);
1919
}
20-
21-
volatile uint32_t uint32_t_blocker = 0;
22-
volatile uint64_t uint64_t_blocker = 0;
23-
volatile unsigned char unsigned_char_blocker = 0;

0 commit comments

Comments
 (0)