Skip to content
Snippets Groups Projects
Commit 39186131 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Small tweaks to make curve25519-donna32 compile with our warnings

parent 8cc08605
No related branches found
No related tags found
No related merge requests found
......@@ -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];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment