X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/89bd399d7d3fdeb58f7a442bcd139b707e08e8d0..0b38b8b77ca6eef0006b1051f86df440fe5ab8dd:/math/f25519.c diff --git a/math/f25519.c b/math/f25519.c index d715033d..7f8e66fc 100644 --- a/math/f25519.c +++ b/math/f25519.c @@ -82,10 +82,10 @@ typedef uint16 upiece; typedef uint32 udblpiece; ((i) == 5 || (i) == 10 || (i) == 15 || (i) == 20 || (i) == 25 ? 9 : 10) #define NPIECE 26 -#define B9 0x200 -#define B8 0x100 #define M10 0x3ff #define M9 0x1ff +#define B9 0x200 +#define B8 0x100 #endif @@ -183,7 +183,7 @@ void f25519_load(f25519 *z, const octet xv[32]) * and lower bounds are achievable. * * All of the x_i at this point are positive, so we don't need to do - * anything wierd when masking them. + * anything weird when masking them. */ b = x9&B24; c = 19&((b >> 19) - (b >> 24)); x9 -= b << 1; b = x8&B25; x9 += b >> 25; x8 -= b << 1; @@ -1178,6 +1178,7 @@ int f25519_quosqrt(f25519 *z, const f25519 *x, const f25519 *y) #ifdef TEST_RIG +#include #include #include #include @@ -1218,7 +1219,7 @@ static void dump_f25519_ref(dstr *d, FILE *fp) } static int eq(const f25519 *x, dstr *d) - { octet b[32]; f25519_store(b, x); return (memcmp(b, d->buf, 32) == 0); } + { octet b[32]; f25519_store(b, x); return (MEMCMP(b, ==, d->buf, 32)); } static const test_type type_f25519 = { cvt_f25519, dump_f25519 },