diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-07-15 15:43:40 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-07-15 15:43:40 +0200 |
commit | 391861311c87a2968f21a3a93f146cc8e0de3181 (patch) | |
tree | 19619b31d0ae799a2240e3385c7af60ee7d1c67b | |
parent | 8cc086059253347c82ebb1ff072abde56cd1da1a (diff) | |
download | tor-391861311c87a2968f21a3a93f146cc8e0de3181.tar.gz tor-391861311c87a2968f21a3a93f146cc8e0de3181.zip |
Small tweaks to make curve25519-donna32 compile with our warnings
-rw-r--r-- | src/ext/curve25519_donna/curve25519-donna.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ext/curve25519_donna/curve25519-donna.c b/src/ext/curve25519_donna/curve25519-donna.c index 75c9f918bd..5a0c3401dd 100644 --- a/src/ext/curve25519_donna/curve25519-donna.c +++ b/src/ext/curve25519_donna/curve25519-donna.c @@ -271,6 +271,7 @@ div_by_2_25(const limb v) return (v + roundoff) >> 25; } +#if 0 /* return v / (2^25), using only shifts and adds. * * On entry: v can take any value. */ @@ -280,6 +281,7 @@ div_s32_by_2_25(const s32 v) const s32 roundoff = ((uint32_t)(v >> 31)) >> 7; return (v + roundoff) >> 25; } +#endif /* Reduce all coefficients of the short form input so that |x| < 2^26. * @@ -485,7 +487,7 @@ fcontract(u8 *output, limb *input_limbs) { /* |input_limbs[i]| < 2^26, so it's valid to convert to an s32. */ for (i = 0; i < 10; i++) { - input[i] = input_limbs[i]; + input[i] = (s32) input_limbs[i]; } for (j = 0; j < 2; ++j) { @@ -848,6 +850,8 @@ crecip(limb *out, const limb *z) { /* 2^255 - 21 */ fmul(out,t1,z11); } +int curve25519_donna(u8 *mypublic, const u8 *secret, const u8 *basepoint); + int curve25519_donna(u8 *mypublic, const u8 *secret, const u8 *basepoint) { limb bp[10], x[10], z[11], zmone[10]; |