diff options
author | Michael Hamburg <mike@shiftleft.org> | 2017-05-31 18:18:31 -0700 |
---|---|---|
committer | Michael Hamburg <mike@shiftleft.org> | 2017-05-31 18:18:31 -0700 |
commit | 3d5962c330c6dbaae2cfd79d6c1fc9f3d2b5cbaa (patch) | |
tree | 7c8b642eb53436385e72a8273cdca07435e01d19 | |
parent | ok so the cpuid problem was an fPIC issue. Hopefully this fixes it... (diff) | |
download | goldilocks-3d5962c330c6dbaae2cfd79d6c1fc9f3d2b5cbaa.tar.xz goldilocks-3d5962c330c6dbaae2cfd79d6c1fc9f3d2b5cbaa.zip |
fix two warnings pointed out by Sofia Celi
-rw-r--r-- | src/GENERATED/c/curve25519/scalar.c | 4 | ||||
-rw-r--r-- | src/GENERATED/c/ed448goldilocks/scalar.c | 4 | ||||
-rw-r--r-- | src/per_curve/scalar.tmpl.c | 4 | ||||
-rw-r--r-- | src/spongerng.c | 1 |
4 files changed, 10 insertions, 3 deletions
diff --git a/src/GENERATED/c/curve25519/scalar.c b/src/GENERATED/c/curve25519/scalar.c index 04a3425..c04475c 100644 --- a/src/GENERATED/c/curve25519/scalar.c +++ b/src/GENERATED/c/curve25519/scalar.c @@ -205,7 +205,9 @@ API_NS(scalar_set_unsigned) ( unsigned int i = 0; for (; i<sizeof(uint64_t)/sizeof(decaf_word_t); i++) { out->limb[i] = w; - w >>= (sizeof(uint64_t) > sizeof(decaf_word_t)) ? 8*sizeof(decaf_word_t) : 0; +#if DECAF_WORD_BITS < 64 + w >>= 8*sizeof(decaf_word_t); +#endif } } diff --git a/src/GENERATED/c/ed448goldilocks/scalar.c b/src/GENERATED/c/ed448goldilocks/scalar.c index 03d58e8..1c98ac9 100644 --- a/src/GENERATED/c/ed448goldilocks/scalar.c +++ b/src/GENERATED/c/ed448goldilocks/scalar.c @@ -205,7 +205,9 @@ API_NS(scalar_set_unsigned) ( unsigned int i = 0; for (; i<sizeof(uint64_t)/sizeof(decaf_word_t); i++) { out->limb[i] = w; - w >>= (sizeof(uint64_t) > sizeof(decaf_word_t)) ? 8*sizeof(decaf_word_t) : 0; +#if DECAF_WORD_BITS < 64 + w >>= 8*sizeof(decaf_word_t); +#endif } } diff --git a/src/per_curve/scalar.tmpl.c b/src/per_curve/scalar.tmpl.c index 5a5b91d..af15851 100644 --- a/src/per_curve/scalar.tmpl.c +++ b/src/per_curve/scalar.tmpl.c @@ -194,7 +194,9 @@ API_NS(scalar_set_unsigned) ( unsigned int i = 0; for (; i<sizeof(uint64_t)/sizeof(decaf_word_t); i++) { out->limb[i] = w; - w >>= (sizeof(uint64_t) > sizeof(decaf_word_t)) ? 8*sizeof(decaf_word_t) : 0; +#if DECAF_WORD_BITS < 64 + w >>= 8*sizeof(decaf_word_t); +#endif } } diff --git a/src/spongerng.c b/src/spongerng.c index 52b424c..6b3136b 100644 --- a/src/spongerng.c +++ b/src/spongerng.c @@ -45,6 +45,7 @@ static void get_cpu_entropy(uint8_t *entropy, size_t len) { #else __asm__("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(1)); #endif + (void)a; (void)b; (void)d; have_rdrand = (c>>30)&1; tested = 1; } |