diff --git a/bench/bench.c b/bench/bench.c index 745ed59..6d21a04 100644 --- a/bench/bench.c +++ b/bench/bench.c @@ -15,13 +15,14 @@ int main(void) { bench_third_party(); bench_fp25519(); + bench_x25519(); + bench_ed25519(); + + bench_fp448(); + bench_x448(); + bench_ed448(); + bench_hash25519(); - // bench_x25519(); - // bench_ed25519(); - // - // bench_fp448(); - // bench_x448(); - // bench_ed448(); printf("==== End of Benchmarking ====\n"); return 0; diff --git a/bench/bench.h b/bench/bench.h index e02c6f7..8337b13 100644 --- a/bench/bench.h +++ b/bench/bench.h @@ -1,16 +1,16 @@ #ifndef PALETA_BENCH_H #define PALETA_BENCH_H -void bench_third_party(); -void bench_fp25519(); -void bench_ecc25519(); -void bench_x25519(); -void bench_ed25519(); -void bench_hash25519(); +void bench_third_party(void); +void bench_fp25519(void); +void bench_ecc25519(void); +void bench_x25519(void); +void bench_ed25519(void); +void bench_hash25519(void); -void bench_fp448(); -void bench_ecc448(); -void bench_x448(); -void bench_ed448(); +void bench_fp448(void); +void bench_ecc448(void); +void bench_x448(void); +void bench_ed448(void); #endif /* PALETA_BENCH_H */ diff --git a/bench/bench_ecdh.c b/bench/bench_ecdh.c index 0abca83..cfeeafe 100644 --- a/bench/bench_ecdh.c +++ b/bench/bench_ecdh.c @@ -19,7 +19,7 @@ static void bench_ecdh(const X_ECDH* ecdh) { ecdh->freeKey(shared_secret); } -void bench_x25519() { +void bench_x25519(void) { printf("===== Benchmarking DH ====\n"); printf("====== X25519 x64 ======\n"); bench_ecdh(&X25519_x64); @@ -27,7 +27,7 @@ void bench_x25519() { bench_ecdh(&X25519); } -void bench_x448() { +void bench_x448(void) { printf("===== Benchmarking DH ====\n"); printf("====== X448 AVX2 ======\n"); bench_ecdh(&X448); diff --git a/bench/bench_eddsa.c b/bench/bench_eddsa.c index 113d7a2..756e95b 100644 --- a/bench/bench_eddsa.c +++ b/bench/bench_eddsa.c @@ -58,13 +58,13 @@ static void bench_ed448context(const SignatureSchemeCtx *eddsa) { eddsa->freeSignature(signature); } -void bench_ed25519() { +void bench_ed25519(void) { printf("== Benchmarking EdDSA ====\n"); printf("====== Ed25519 AVX2 ======\n"); bench_ed255pure(&Ed25519.Pure); } -void bench_ed448() { +void bench_ed448(void) { printf("== Benchmarking EdDSA ====\n"); printf("====== Ed448 AVX2 ======\n"); bench_ed448context(&Ed448.PureContext); diff --git a/bench/bench_fp.c b/bench/bench_fp.c index 3ff3b74..d2fb534 100644 --- a/bench/bench_fp.c +++ b/bench/bench_fp.c @@ -63,7 +63,7 @@ static void bench_4w(const Arith_4w *fp) { fp->misc.free(c); } -void bench_fp25519() { +void bench_fp25519(void) { printf("=== Benchmarking Arith ===\n"); printf("====== p=2^255-19 ======\n"); printf("====== 1-way (full) ======\n"); @@ -76,7 +76,7 @@ void bench_fp25519() { bench_4w(&Fp25519._4w_red.arith); } -void bench_fp448() { +void bench_fp448(void) { printf("=== Benchmarking Arith ===\n"); printf("==== p=2^448-2^224-1 =====\n"); printf("====== 1-way (full) ======\n"); diff --git a/bench/bench_hash.c b/bench/bench_hash.c index 38b3818..5af9dc8 100644 --- a/bench/bench_hash.c +++ b/bench/bench_hash.c @@ -4,7 +4,7 @@ #include "clocks.h" -void bench_hash25519() { +void bench_hash25519(void) { printf("=== Benchmarking Hash ====\n"); printf("===== Hash25519 AVX2 =====\n"); diff --git a/bench/bench_third_party.c b/bench/bench_third_party.c index 0f97ada..cdca522 100644 --- a/bench/bench_third_party.c +++ b/bench/bench_third_party.c @@ -6,7 +6,7 @@ #include "clocks.h" -static void bench_sha512_2w() { +static void bench_sha512_2w(void) { const int BENCH = 500; const int NUM = 2; const int MSG_LEN = 64; @@ -25,7 +25,7 @@ static void bench_sha512_2w() { } } -void bench_third_party() { +void bench_third_party(void) { const int BENCH = 500; const int message_length = 64; uint8_t message[message_length]; diff --git a/bench/clocks.c b/bench/clocks.c index 78eb1fc..0a25e6b 100644 --- a/bench/clocks.c +++ b/bench/clocks.c @@ -2,7 +2,7 @@ #include #include -uint64_t time_now() { +uint64_t time_now(void) { struct timeval tv; uint64_t ret; diff --git a/bench/clocks.h b/bench/clocks.h index ac24731..a217990 100644 --- a/bench/clocks.h +++ b/bench/clocks.h @@ -79,7 +79,7 @@ (unsigned long)((end_c - start_c) / iterations)); \ } while (0) -uint64_t time_now(); +uint64_t time_now(void); uint64_t cycles_now(void); /* _CLOCKS_H_ */ diff --git a/include/faz_eddsa_avx2.h b/include/faz_eddsa_avx2.h index e015401..eb25b4e 100644 --- a/include/faz_eddsa_avx2.h +++ b/include/faz_eddsa_avx2.h @@ -38,7 +38,7 @@ namespace faz{ namespace eddsa{ #endif /* __cplusplus */ -#define ZeroOperandReturnKey(X) uint8_t * (*X)() +#define ZeroOperandReturnKey(X) uint8_t * (*X)(void) #define Oper1Void(NAME, TYPE) void (*NAME)(TYPE C) #define Oper1File(NAME, TYPE) void (*NAME)(FILE* file, TYPE A) diff --git a/src/eltfp25519_1w_redradix.c b/src/eltfp25519_1w_redradix.c index c715cf1..b2e733e 100644 --- a/src/eltfp25519_1w_redradix.c +++ b/src/eltfp25519_1w_redradix.c @@ -816,7 +816,7 @@ DECL(void, print)(FILE *file, argElement_1w a) { print_hex_bytes(file, a_bytes, SIZE_FP25519); } -DECL(argElement_1w, alloc)() { +DECL(argElement_1w, alloc)(void) { return (argElement_1w) allocate_bytes((4 * ((NUM_DIGITS_FP25519 + 3) / 4)) * sizeof(uint64_t)); } diff --git a/src/eltfp25519_2w_redradix.c b/src/eltfp25519_2w_redradix.c index 5d1c041..60f8b7b 100644 --- a/src/eltfp25519_2w_redradix.c +++ b/src/eltfp25519_2w_redradix.c @@ -686,7 +686,7 @@ DECL(__m256i, cmp)(argElement_2w a, argElement_2w b) { return SET64(0, c1, 0, c0); } -DECL(argElement_2w, alloc)() { +DECL(argElement_2w, alloc)(void) { return (argElement_2w) allocate_bytes((NUM_DIGITS_FP25519 / 2) * sizeof(__m256i)); } diff --git a/src/eltfp25519_4w_redradix.c b/src/eltfp25519_4w_redradix.c index a65659a..cc68d79 100644 --- a/src/eltfp25519_4w_redradix.c +++ b/src/eltfp25519_4w_redradix.c @@ -892,7 +892,7 @@ DECL(void, srt)(argElement_4w c, argElement_4w a) { FN(invsqrt)(c, c, a); } -DECL(argElement_4w,alloc)() { +DECL(argElement_4w,alloc)(void) { return (argElement_4w) allocate_bytes(NUM_DIGITS_FP25519 * sizeof(__m256i)); } diff --git a/src/eltfp448_1w_redradix.c b/src/eltfp448_1w_redradix.c index 0f080fc..26fecfa 100644 --- a/src/eltfp448_1w_redradix.c +++ b/src/eltfp448_1w_redradix.c @@ -750,7 +750,7 @@ DECL(void, print)(FILE *file, argElement_1w a) { print_hex_bytes(file, a_bytes, SIZE_FP448); } -DECL(argElement_1w, alloc)() { +DECL(argElement_1w, alloc)(void) { return (argElement_1w) allocate_bytes( (NUM_DIGITS_FP448) * sizeof(uint64_t)); } diff --git a/src/eltfp448_2w_redradix.c b/src/eltfp448_2w_redradix.c index 0a733a3..2aa1697 100644 --- a/src/eltfp448_2w_redradix.c +++ b/src/eltfp448_2w_redradix.c @@ -674,7 +674,7 @@ DECL(__m256i, cmp)(argElement_2w a, argElement_2w b) { return SET64(0, c1, 0, c0); } -DECL(argElement_2w, alloc)() { +DECL(argElement_2w, alloc)(void) { return (argElement_2w) allocate_bytes((NUM_DIGITS_FP448 / 2) * sizeof(__m256i)); } diff --git a/src/eltfp448_4w_redradix.c b/src/eltfp448_4w_redradix.c index 7e36d79..67cf7f1 100644 --- a/src/eltfp448_4w_redradix.c +++ b/src/eltfp448_4w_redradix.c @@ -687,7 +687,7 @@ DECL(void, ser)(uint8_t *buf, argElement_4w a) { ser_Fp448_1w_redradix(buf+3*SIZE_FP448,a3); } -DECL(argElement_4w,alloc)() { +DECL(argElement_4w,alloc)(void) { return (argElement_4w) allocate_bytes(NUM_DIGITS_FP448 * sizeof(__m256i)); } diff --git a/src/ladder255.c b/src/ladder255.c index e4813d4..fc6c11a 100644 --- a/src/ladder255.c +++ b/src/ladder255.c @@ -23,7 +23,7 @@ #include "edwards255.h" #include -static inline uint8_t *allocX25519_Key() { +static inline uint8_t *allocX25519_Key(void) { return (uint8_t *) allocate_bytes(ECDH25519_KEY_SIZE_BYTES * sizeof(uint8_t)); } diff --git a/src/ladder448.c b/src/ladder448.c index 17e9572..6b6d7a3 100644 --- a/src/ladder448.c +++ b/src/ladder448.c @@ -27,7 +27,7 @@ * * @return */ -static inline uint8_t * allocX448_Key() { +static inline uint8_t * allocX448_Key(void) { return (uint8_t*) allocate_bytes(ECDH448_KEY_SIZE_BYTES * sizeof(uint8_t)); } diff --git a/src/sign255.c b/src/sign255.c index c71f3ea..b4618ca 100644 --- a/src/sign255.c +++ b/src/sign255.c @@ -51,7 +51,7 @@ static inline void printEd25519_Signature(FILE * file,uint8_t *sig) { * * @return */ -static inline uint8_t *allocEd25519_Key() { +static inline uint8_t *allocEd25519_Key(void) { return (uint8_t *) allocate_bytes(ED25519_KEY_SIZE_BYTES_PARAM * sizeof(uint8_t)); } @@ -59,7 +59,7 @@ static inline uint8_t *allocEd25519_Key() { * * @return */ -static inline uint8_t *allocEd25519_Signature() { +static inline uint8_t *allocEd25519_Signature(void) { return (uint8_t *) allocate_bytes(ED25519_SIG_SIZE_BYTES_PARAM * sizeof(uint8_t)); } diff --git a/src/sign448.c b/src/sign448.c index 4a4a1ad..997e7c8 100644 --- a/src/sign448.c +++ b/src/sign448.c @@ -51,7 +51,7 @@ static inline void printEd448_Signature(FILE *file, uint8_t *sig) { * * @return */ -static inline uint8_t *allocEd448_Key() { +static inline uint8_t *allocEd448_Key(void) { return (uint8_t *) allocate_bytes(ED448_KEY_SIZE_BYTES_PARAM * sizeof(uint8_t)); } @@ -59,7 +59,7 @@ static inline uint8_t *allocEd448_Key() { * * @return */ -static inline uint8_t *allocEd448_Signature() { +static inline uint8_t *allocEd448_Signature(void) { return (uint8_t *) allocate_bytes(ED448_SIG_SIZE_BYTES_PARAM * sizeof(uint8_t)); } diff --git a/third_party/cpu_caps.c b/third_party/cpu_caps.c index f23bfe7..2bca091 100644 --- a/third_party/cpu_caps.c +++ b/third_party/cpu_caps.c @@ -62,7 +62,7 @@ int cpu_has(enum Capabilities c) { return ret; } -void machine_info() { +void machine_info(void) { printf("=== Environment Information ====\n"); printf("Program compiled with: %s\n", __VERSION__); unsigned int eax, ebx, ecx, edx; diff --git a/third_party/cpu_caps.h b/third_party/cpu_caps.h index 66690a6..6a1fea2 100644 --- a/third_party/cpu_caps.h +++ b/third_party/cpu_caps.h @@ -5,7 +5,7 @@ extern "C" { #endif /* __cplusplus */ -void machine_info(); +void machine_info(void); #ifdef __cplusplus } /* extern C */