aboutsummaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-11 17:49:18 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-11 17:49:18 -0400
commit2b26815e09760cc84b18791bdbfca27c7b8334f4 (patch)
tree5ece956fc3700f53b3c32e2292303b2d7e749de9 /src/ext
parentc894e9d3d44bceaf209a9b73c2c43911af3eb1a8 (diff)
parent6cd5a80275614105ccf8794465b6ba5c0c5e8f3f (diff)
downloadtor-2b26815e09760cc84b18791bdbfca27c7b8334f4.tar.gz
tor-2b26815e09760cc84b18791bdbfca27c7b8334f4.zip
Merge branch 'maint-0.2.9' into maint-0.3.0
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/csiphash.c14
-rw-r--r--src/ext/ed25519/donna/modm-donna-32bit.h48
-rw-r--r--src/ext/ed25519/donna/modm-donna-64bit.h24
3 files changed, 43 insertions, 43 deletions
diff --git a/src/ext/csiphash.c b/src/ext/csiphash.c
index 8348c66048..a8f3d5b8b8 100644
--- a/src/ext/csiphash.c
+++ b/src/ext/csiphash.c
@@ -122,13 +122,13 @@ uint64_t siphash24(const void *src, unsigned long src_sz, const struct sipkey *k
}
switch (src_sz - blocks) {
- case 7: last7 |= (uint64_t)m[i + 6] << 48;
- case 6: last7 |= (uint64_t)m[i + 5] << 40;
- case 5: last7 |= (uint64_t)m[i + 4] << 32;
- case 4: last7 |= (uint64_t)m[i + 3] << 24;
- case 3: last7 |= (uint64_t)m[i + 2] << 16;
- case 2: last7 |= (uint64_t)m[i + 1] << 8;
- case 1: last7 |= (uint64_t)m[i + 0] ;
+ case 7: last7 |= (uint64_t)m[i + 6] << 48; /* Falls through. */
+ case 6: last7 |= (uint64_t)m[i + 5] << 40; /* Falls through. */
+ case 5: last7 |= (uint64_t)m[i + 4] << 32; /* Falls through. */
+ case 4: last7 |= (uint64_t)m[i + 3] << 24; /* Falls through. */
+ case 3: last7 |= (uint64_t)m[i + 2] << 16; /* Falls through. */
+ case 2: last7 |= (uint64_t)m[i + 1] << 8; /* Falls through. */
+ case 1: last7 |= (uint64_t)m[i + 0] ; /* Falls through. */
case 0:
default:;
}
diff --git a/src/ext/ed25519/donna/modm-donna-32bit.h b/src/ext/ed25519/donna/modm-donna-32bit.h
index 5f36df655d..0ef9e58fa1 100644
--- a/src/ext/ed25519/donna/modm-donna-32bit.h
+++ b/src/ext/ed25519/donna/modm-donna-32bit.h
@@ -385,14 +385,14 @@ sub256_modm_batch(bignum256modm out, const bignum256modm a, const bignum256modm
size_t i = 0;
bignum256modm_element_t carry = 0;
switch (limbsize) {
- case 8: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 7: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 6: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 5: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 4: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 3: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 2: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
- case 1: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++;
+ case 8: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 7: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 6: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 5: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 4: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 3: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 2: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
+ case 1: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 31); out[i] &= 0x3fffffff; i++; /* Falls through. */
case 0:
default: out[i] = (a[i] - b[i]) - carry;
}
@@ -403,14 +403,14 @@ sub256_modm_batch(bignum256modm out, const bignum256modm a, const bignum256modm
static int
lt256_modm_batch(const bignum256modm a, const bignum256modm b, size_t limbsize) {
switch (limbsize) {
- case 8: if (a[8] > b[8]) return 0; if (a[8] < b[8]) return 1;
- case 7: if (a[7] > b[7]) return 0; if (a[7] < b[7]) return 1;
- case 6: if (a[6] > b[6]) return 0; if (a[6] < b[6]) return 1;
- case 5: if (a[5] > b[5]) return 0; if (a[5] < b[5]) return 1;
- case 4: if (a[4] > b[4]) return 0; if (a[4] < b[4]) return 1;
- case 3: if (a[3] > b[3]) return 0; if (a[3] < b[3]) return 1;
- case 2: if (a[2] > b[2]) return 0; if (a[2] < b[2]) return 1;
- case 1: if (a[1] > b[1]) return 0; if (a[1] < b[1]) return 1;
+ case 8: if (a[8] > b[8]) return 0; if (a[8] < b[8]) return 1; /* Falls through. */
+ case 7: if (a[7] > b[7]) return 0; if (a[7] < b[7]) return 1; /* Falls through. */
+ case 6: if (a[6] > b[6]) return 0; if (a[6] < b[6]) return 1; /* Falls through. */
+ case 5: if (a[5] > b[5]) return 0; if (a[5] < b[5]) return 1; /* Falls through. */
+ case 4: if (a[4] > b[4]) return 0; if (a[4] < b[4]) return 1; /* Falls through. */
+ case 3: if (a[3] > b[3]) return 0; if (a[3] < b[3]) return 1; /* Falls through. */
+ case 2: if (a[2] > b[2]) return 0; if (a[2] < b[2]) return 1; /* Falls through. */
+ case 1: if (a[1] > b[1]) return 0; if (a[1] < b[1]) return 1; /* Falls through. */
case 0: if (a[0] > b[0]) return 0; if (a[0] < b[0]) return 1;
}
return 0;
@@ -420,14 +420,14 @@ lt256_modm_batch(const bignum256modm a, const bignum256modm b, size_t limbsize)
static int
lte256_modm_batch(const bignum256modm a, const bignum256modm b, size_t limbsize) {
switch (limbsize) {
- case 8: if (a[8] > b[8]) return 0; if (a[8] < b[8]) return 1;
- case 7: if (a[7] > b[7]) return 0; if (a[7] < b[7]) return 1;
- case 6: if (a[6] > b[6]) return 0; if (a[6] < b[6]) return 1;
- case 5: if (a[5] > b[5]) return 0; if (a[5] < b[5]) return 1;
- case 4: if (a[4] > b[4]) return 0; if (a[4] < b[4]) return 1;
- case 3: if (a[3] > b[3]) return 0; if (a[3] < b[3]) return 1;
- case 2: if (a[2] > b[2]) return 0; if (a[2] < b[2]) return 1;
- case 1: if (a[1] > b[1]) return 0; if (a[1] < b[1]) return 1;
+ case 8: if (a[8] > b[8]) return 0; if (a[8] < b[8]) return 1; /* Falls through. */
+ case 7: if (a[7] > b[7]) return 0; if (a[7] < b[7]) return 1; /* Falls through. */
+ case 6: if (a[6] > b[6]) return 0; if (a[6] < b[6]) return 1; /* Falls through. */
+ case 5: if (a[5] > b[5]) return 0; if (a[5] < b[5]) return 1; /* Falls through. */
+ case 4: if (a[4] > b[4]) return 0; if (a[4] < b[4]) return 1; /* Falls through. */
+ case 3: if (a[3] > b[3]) return 0; if (a[3] < b[3]) return 1; /* Falls through. */
+ case 2: if (a[2] > b[2]) return 0; if (a[2] < b[2]) return 1; /* Falls through. */
+ case 1: if (a[1] > b[1]) return 0; if (a[1] < b[1]) return 1; /* Falls through. */
case 0: if (a[0] > b[0]) return 0; if (a[0] < b[0]) return 1;
}
return 1;
diff --git a/src/ext/ed25519/donna/modm-donna-64bit.h b/src/ext/ed25519/donna/modm-donna-64bit.h
index 012ea9ea08..06c98e3039 100644
--- a/src/ext/ed25519/donna/modm-donna-64bit.h
+++ b/src/ext/ed25519/donna/modm-donna-64bit.h
@@ -294,10 +294,10 @@ sub256_modm_batch(bignum256modm out, const bignum256modm a, const bignum256modm
size_t i = 0;
bignum256modm_element_t carry = 0;
switch (limbsize) {
- case 4: out[i] = (a[i] - b[i]) ; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++;
- case 3: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++;
- case 2: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++;
- case 1: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++;
+ case 4: out[i] = (a[i] - b[i]) ; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++; /* Falls through. */
+ case 3: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++; /* Falls through. */
+ case 2: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++; /* Falls through. */
+ case 1: out[i] = (a[i] - b[i]) - carry; carry = (out[i] >> 63); out[i] &= 0xffffffffffffff; i++; /* Falls through. */
case 0:
default: out[i] = (a[i] - b[i]) - carry;
}
@@ -310,10 +310,10 @@ lt256_modm_batch(const bignum256modm a, const bignum256modm b, size_t limbsize)
size_t i = 0;
bignum256modm_element_t t, carry = 0;
switch (limbsize) {
- case 4: t = (a[i] - b[i]) ; carry = (t >> 63); i++;
- case 3: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++;
- case 2: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++;
- case 1: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++;
+ case 4: t = (a[i] - b[i]) ; carry = (t >> 63); i++; /* Falls through. */
+ case 3: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
+ case 2: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
+ case 1: t = (a[i] - b[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
case 0: t = (a[i] - b[i]) - carry; carry = (t >> 63);
}
return (int)carry;
@@ -325,10 +325,10 @@ lte256_modm_batch(const bignum256modm a, const bignum256modm b, size_t limbsize)
size_t i = 0;
bignum256modm_element_t t, carry = 0;
switch (limbsize) {
- case 4: t = (b[i] - a[i]) ; carry = (t >> 63); i++;
- case 3: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++;
- case 2: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++;
- case 1: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++;
+ case 4: t = (b[i] - a[i]) ; carry = (t >> 63); i++; /* Falls through. */
+ case 3: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
+ case 2: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
+ case 1: t = (b[i] - a[i]) - carry; carry = (t >> 63); i++; /* Falls through. */
case 0: t = (b[i] - a[i]) - carry; carry = (t >> 63);
}
return (int)!carry;