diff --git a/src/common/sha3/xkcp_sha3.c b/src/common/sha3/xkcp_sha3.c index 504de05b1..b76de44c1 100644 --- a/src/common/sha3/xkcp_sha3.c +++ b/src/common/sha3/xkcp_sha3.c @@ -104,7 +104,7 @@ static void keccak_inc_reset(uint64_t *s) { **************************************************/ static void keccak_inc_absorb(uint64_t *s, uint32_t r, const uint8_t *m, size_t mlen) { - size_t c; + uint64_t c; if (s[25] && mlen + s[25] >= r) { c = r - s[25]; diff --git a/src/common/sha3/xkcp_sha3x4.c b/src/common/sha3/xkcp_sha3x4.c index 2a6d404f9..29399b02c 100644 --- a/src/common/sha3/xkcp_sha3x4.c +++ b/src/common/sha3/xkcp_sha3x4.c @@ -70,7 +70,7 @@ static void keccak_x4_inc_reset(uint64_t *s) { static void keccak_x4_inc_absorb(uint64_t *s, uint32_t r, const uint8_t *in0, const uint8_t *in1, const uint8_t *in2, const uint8_t *in3, size_t inlen) { - size_t c; + uint64_t c; if (s[100] && inlen + s[100] >= r) { c = r - s[100]; diff --git a/src/kem/sike/external/config.h b/src/kem/sike/external/config.h index 591f1cd55..85241a3b5 100644 --- a/src/kem/sike/external/config.h +++ b/src/kem/sike/external/config.h @@ -137,15 +137,15 @@ typedef uint64_t uint128_t[2]; // The following functions return 1 (TRUE) if condition is true, 0 (FALSE) otherwise -static __inline unsigned int is_digit_nonzero_ct(digit_t x) { // Is x != 0? +__inline unsigned int is_digit_nonzero_ct(digit_t x) { // Is x != 0? return (unsigned int) ((x | (0 - x)) >> (RADIX - 1)); } -static __inline unsigned int is_digit_zero_ct(digit_t x) { // Is x = 0? +__inline unsigned int is_digit_zero_ct(digit_t x) { // Is x = 0? return (unsigned int) (1 ^ is_digit_nonzero_ct(x)); } -static __inline unsigned int is_digit_lessthan_ct(digit_t x, digit_t y) { // Is x < y? +__inline unsigned int is_digit_lessthan_ct(digit_t x, digit_t y) { // Is x < y? return (unsigned int) ((x ^ ((x ^ y) | ((x - y) ^ y))) >> (RADIX - 1)); } diff --git a/tests/ds_benchmark.h b/tests/ds_benchmark.h index c75732180..5c4210954 100644 --- a/tests/ds_benchmark.h +++ b/tests/ds_benchmark.h @@ -132,8 +132,8 @@ static uint64_t _bench_rdtsc(void) { /* Use the ARM performance counters. */ unsigned int value; /* Read CCNT Register */ - asm volatile("mrc p15, 0, %0, c9, c13, 0\t\n" - : "=r"(value)); + __asm__ volatile("mrc p15, 0, %0, c9, c13, 0\t\n" + : "=r"(value)); return value; #else #define USING_TIME_RATHER_THAN_CYCLES @@ -161,13 +161,13 @@ static void _bench_init_perfcounters(int32_t do_reset, int32_t enable_divider) { value |= 16; /* Program the performance-counter control-register */ - asm volatile("mcr p15, 0, %0, c9, c12, 0\t\n" ::"r"(value)); + __asm__ volatile("mcr p15, 0, %0, c9, c12, 0\t\n" ::"r"(value)); /* Enable all counters */ - asm volatile("mcr p15, 0, %0, c9, c12, 1\t\n" ::"r"(0x8000000f)); + __asm__ volatile("mcr p15, 0, %0, c9, c12, 1\t\n" ::"r"(0x8000000f)); /* Clear overflows */ - asm volatile("mcr p15, 0, %0, c9, c12, 3\t\n" ::"r"(0x8000000f)); + __asm__ volatile("mcr p15, 0, %0, c9, c12, 3\t\n" ::"r"(0x8000000f)); } #endif