diff --git a/src/decaf_fast.c b/src/decaf_fast.c index ca1bd30..d859dc1 100644 --- a/src/decaf_fast.c +++ b/src/decaf_fast.c @@ -483,7 +483,8 @@ static void deisogenize ( gf_mul ( a, p->z, t ); /* "tz" = T*Z */ gf_sqr ( b, a ); gf_mul ( d, b, c ); /* (TZ)^2 * (Z^2-X^2) */ - gf_isqrt ( b, d ); + decaf_bool_t ok = gf_isqrt_chk ( b, d, DECAF_TRUE ); + (void)ok; assert(ok); gf_mul ( d, b, a ); /* "osx" = 1 / sqrt(z^2-x^2) */ gf_mul ( a, b, c ); gf_mul ( b, a, d ); /* 1/tz */ diff --git a/src/p25519/f_arithmetic.c b/src/p25519/f_arithmetic.c index 5f01ac4..c211388 100644 --- a/src/p25519/f_arithmetic.c +++ b/src/p25519/f_arithmetic.c @@ -10,7 +10,7 @@ #include "field.h" -const field_a_t SQRT_MINUS_ONE = {FIELD_LITERAL( // FIXME goes elsewhere? +const field_a_t P25519_SQRT_MINUS_ONE = {FIELD_LITERAL( 0x61b274a0ea0b0, 0x0d5a5fc8f189d, 0x7ef5e9cbd0c60, diff --git a/src/p25519/f_field.h b/src/p25519/f_field.h index 81af1fd..e63596a 100644 --- a/src/p25519/f_field.h +++ b/src/p25519/f_field.h @@ -27,5 +27,6 @@ #define field_strong_reduce p255_strong_reduce #define field_serialize p255_serialize #define field_deserialize p255_deserialize +#define SQRT_MINUS_ONE P25519_SQRT_MINUS_ONE #endif /* __F_FIELD_H__ */