From 30c05eb26666237d6e042063fb3b78933353281d Mon Sep 17 00:00:00 2001 From: cathugger Date: Tue, 14 Jan 2020 17:51:56 +0000 Subject: [PATCH] remove some unused stuff, small fixups, use -Wextra --- GNUmakefile.in | 18 ---- configure.ac | 8 ++ ed25519/amd64-51-30k/batch.c | 94 ------------------- ed25519/amd64-51-30k/crypto_sign.h | 2 +- ed25519/amd64-64-24k/batch.c | 94 ------------------- .../ed25519-donna/curve25519-donna-helpers.h | 2 +- 6 files changed, 10 insertions(+), 208 deletions(-) delete mode 100644 ed25519/amd64-51-30k/batch.c delete mode 100644 ed25519/amd64-64-24k/batch.c diff --git a/GNUmakefile.in b/GNUmakefile.in index 0a90819..67c9028 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -135,15 +135,6 @@ base32_to.c.o: types.h base32.h base64_from.c.o: types.h base64.h base64_to.c.o: types.h base64.h cpucount.c.o: cpucount.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/crypto_sign.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/ed25519.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/crypto_verify_32.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/crypto_hash_sha512.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/randombytes.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/ge25519.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/fe25519.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/sc25519.h -ed25519/amd64-51-30k/batch.c.o: ed25519/amd64-51-30k/hram.h ed25519/amd64-51-30k/fe25519_add.c.o: ed25519/amd64-51-30k/fe25519.h ed25519/amd64-51-30k/fe25519_batchinvert.c.o: ed25519/amd64-51-30k/fe25519.h ed25519/amd64-51-30k/fe25519_getparity.c.o: ed25519/amd64-51-30k/fe25519.h @@ -222,15 +213,6 @@ ed25519/amd64-51-30k/sign.c.o: ed25519/amd64-51-30k/crypto_hash_sha512.h ed25519/amd64-51-30k/sign.c.o: ed25519/amd64-51-30k/ge25519.h ed25519/amd64-51-30k/sign.c.o: ed25519/amd64-51-30k/fe25519.h ed25519/amd64-51-30k/sign.c.o: ed25519/amd64-51-30k/sc25519.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/crypto_sign.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/ed25519.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/crypto_verify_32.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/crypto_hash_sha512.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/randombytes.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/ge25519.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/fe25519.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/sc25519.h -ed25519/amd64-64-24k/batch.c.o: ed25519/amd64-51-30k/hram.h ed25519/amd64-64-24k/fe25519_batchinvert.c.o: ed25519/amd64-51-30k/fe25519.h ed25519/amd64-64-24k/fe25519_getparity.c.o: ed25519/amd64-51-30k/fe25519.h ed25519/amd64-64-24k/fe25519_invert.c.o: ed25519/amd64-51-30k/fe25519.h diff --git a/configure.ac b/configure.ac index f4804fa..9c2ddac 100644 --- a/configure.ac +++ b/configure.ac @@ -192,6 +192,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([no])] ) +CFLAGS="$cstd -Wextra" +AC_MSG_CHECKING([whether CC supports -Wextra]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [cstd="$cstd -Wextra"], + [AC_MSG_RESULT([no])] +) + # (negative) detection on clang fails without -Werror CFLAGS="$cstd -Wno-maybe-uninitialized -Werror" AC_MSG_CHECKING([whether CC supports -Wno-maybe-uninitialized]) diff --git a/ed25519/amd64-51-30k/batch.c b/ed25519/amd64-51-30k/batch.c deleted file mode 100644 index 955392e..0000000 --- a/ed25519/amd64-51-30k/batch.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "crypto_sign.h" - -#include "crypto_verify_32.h" -#include "crypto_hash_sha512.h" -#include "randombytes.h" - -#include "ge25519.h" -#include "hram.h" - -#define MAXBATCH 64 - -int crypto_sign_open_batch( - unsigned char* const m[],unsigned long long mlen[], - unsigned char* const sm[],const unsigned long long smlen[], - unsigned char* const pk[], - unsigned long long num - ) -{ - int ret = 0; - unsigned long long i, j; - shortsc25519 r[MAXBATCH]; - sc25519 scalars[2*MAXBATCH+1]; - ge25519 points[2*MAXBATCH+1]; - unsigned char hram[crypto_hash_sha512_BYTES]; - unsigned long long batchsize; - - for (i = 0;i < num;++i) mlen[i] = -1; - - while (num >= 3) { - batchsize = num; - if (batchsize > MAXBATCH) batchsize = MAXBATCH; - - for (i = 0;i < batchsize;++i) - if (smlen[i] < 64) goto fallback; - - randombytes((unsigned char*)r,sizeof(shortsc25519) * batchsize); - - /* Computing scalars[0] = ((r1s1 + r2s2 + ...)) */ - for(i=0;i= 3) { - batchsize = num; - if (batchsize > MAXBATCH) batchsize = MAXBATCH; - - for (i = 0;i < batchsize;++i) - if (smlen[i] < 64) goto fallback; - - randombytes((unsigned char*)r,sizeof(shortsc25519) * batchsize); - - /* Computing scalars[0] = ((r1s1 + r2s2 + ...)) */ - for(i=0;i