Skip to content

Commit

Permalink
Fix commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Dec 28, 2024
1 parent c1a5fb5 commit 8848a0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 1 addition & 5 deletions bench/bench_bn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 5 additions & 4 deletions include/relic_bn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/relic_ep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8848a0f

Please sign in to comment.