diff --git a/bench/bench_bn.c b/bench/bench_bn.c index 466e1d4e7..18640af9a 100644 --- a/bench/bench_bn.c +++ b/bench/bench_bn.c @@ -1000,14 +1000,10 @@ static void arith(void) { #if defined(WITH_EP) && defined(EP_ENDOM) && (EP_MUL == LWNAF || EP_FIX == COMBS || EP_FIX == LWNAF || EP_SIM == INTER || !defined(STRIP)) if (ep_param_set_any_endom() == RLC_OK) { - for (size_t i = 0; i < 3; i++) { - bn_copy(d[i], ep_curve_get_v1()[i]); - bn_copy(e[i], ep_curve_get_v2()[i]); - } BENCH_RUN("bn_rec_glv") { ep_curve_get_ord(c); bn_rand_mod(a, c); - BENCH_ADD(bn_rec_glv(a, b, a, c, (const bn_t *)d, (const bn_t *)e)); + BENCH_ADD(bn_rec_glv(a, b, a, c, ep_curve_get_v1(), ep_curve_get_v2())); } BENCH_END; } diff --git a/include/relic_bn.h b/include/relic_bn.h index 7b1a39587..403df0694 100644 --- a/include/relic_bn.h +++ b/include/relic_bn.h @@ -1525,8 +1525,8 @@ void bn_rec_jsf(int8_t *jsf, size_t *len, const bn_t k, const bn_t l); * @param[in] v1 - the set of parameters v1 for the GLV method. * @param[in] v2 - the set of parameters v2 for the GLV method. */ -void bn_rec_glv(bn_t k0, bn_t k1, const bn_t k, const bn_t n, const bn_t v1[], - const bn_t v2[]); +void bn_rec_glv(bn_t k0, bn_t k1, const bn_t k, const bn_t n, const bn_st *v1, + const bn_st *v2); /** * Recodes a scalar in subscalars according to Frobenius endomorphism. @@ -1545,14 +1545,15 @@ void bn_rec_frb(bn_t *ki, int sub, const bn_t k, const bn_t x, const bn_t n, * Recodes subscalars in the signed aligned column representation.. * * @param[out] b - the recoded subscalars. - * @param[in] len - the length in bytes of the recoding. + * @param[in,out] len - the length in bytes of the recoding. * @param[in] k - the subscalars to recode. * @param[in] c - the splitting factor. * @param[in] m - the number of subscalars to recode. * @param[in] n - the bit length of the group order. * @throw ERR_NO_BUFFER - if the buffer capacity is insufficient. */ -void bn_rec_sac(int8_t *b, size_t *len, bn_t *k, size_t c, size_t m, size_t n); +void bn_rec_sac(int8_t *b, size_t *len, const bn_t *k, size_t c, size_t m, + size_t n); /** * Computes the coefficients of the polynomial representing the Lagrange diff --git a/include/relic_ep.h b/include/relic_ep.h index 821fb8b8f..f81a9c95c 100644 --- a/include/relic_ep.h +++ b/include/relic_ep.h @@ -540,12 +540,12 @@ dig_t *ep_curve_get_beta(void); /** * Returns the parameter V1 of the prime curve. */ -const bn_t *ep_curve_get_v1(void); +const bn_st *ep_curve_get_v1(void); /** * Returns the parameter V2 of the prime curve. */ -const bn_t *ep_curve_get_v2(void); +const bn_st *ep_curve_get_v2(void); /** * Returns a optimization identifier based on the a-coefficient of the curve.