Skip to content

Commit

Permalink
Some fixes to STRIP support.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jan 27, 2025
1 parent 1f8ef05 commit 802ce0d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
2 changes: 0 additions & 2 deletions include/relic_ed.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ typedef struct {
fp_st y;
/** The third coordinate (projective representation). */
fp_st z;
#if ED_ADD == EXTND || !defined(STRIP)
/** The forth coordinate (extended coordinates) */
fp_st t;
#endif
/** Flag to indicate the coordinate system of this point. */
int coord;
} ed_st;
Expand Down
4 changes: 2 additions & 2 deletions src/ep/relic_ep_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ void ep_map_rnd(ep_t p, const uint8_t *uniform_bytes, size_t len) {

#if EP_MAP == BASIC
ep_map_basic_impl(p, uniform_bytes, len);
#elif EP_MAP == SSWUM
ep_map_swift_impl(p, uniform_bytes, len);
#elif EP_MAP == SWIFT
ep_map_swift_impl(p, uniform_bytes, len);
#elif EP_MAP == SSWUM
/* figure out which hash function to use */
const int abNeq0 = (ep_curve_opt_a() != RLC_ZERO) &&
(ep_curve_opt_b() != RLC_ZERO);
Expand Down
2 changes: 0 additions & 2 deletions src/ep/relic_ep_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ static void ep_mul_naf_imp(ep_t r, const ep_t p, const bn_t k) {
#endif /* EP_PLAIN || EP_SUPER */
#endif /* EP_MUL == LWNAF */

#if EP_MUL == LWREG || !defined(STRIP)
#if defined(EP_ENDOM)

static void ep_mul_reg_glv(ep_t r, const ep_t p, const bn_t k) {
Expand Down Expand Up @@ -404,7 +403,6 @@ static void ep_mul_reg_imp(ep_t r, const ep_t p, const bn_t k) {
}

#endif /* EP_PLAIN || EP_SUPER */
#endif /* EP_MUL == LWREG */

/*============================================================================*/
/* Public definitions */
Expand Down
2 changes: 2 additions & 0 deletions src/ep/relic_ep_mul_cof.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ void ep_mul_cof(ep_t r, const ep_t p) {
break;
#endif
default:
(void)u;
(void)v;
/* multiply by cofactor to get the correct group. */
ep_curve_get_cof(k);
ep_mul_big(r, p, k);
Expand Down
7 changes: 0 additions & 7 deletions src/epx/relic_ep2_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ static void ep2_mul_gls_imp(ep2_t r, const ep2_t p, const bn_t k) {

#endif /* EP_MUL == LWNAF */

#if EP_MUL == LWREG || !defined(STRIP)

static void ep2_mul_reg_gls(ep2_t r, const ep2_t p, const bn_t k) {
size_t l;
bn_t n, _k[4], u;
Expand Down Expand Up @@ -243,7 +241,6 @@ static void ep2_mul_reg_gls(ep2_t r, const ep2_t p, const bn_t k) {
}
}

#endif /* EP_MUL == LWREG */
#endif /* EP_ENDOM */

#if defined(EP_PLAIN) || defined(EP_SUPER)
Expand Down Expand Up @@ -614,8 +611,6 @@ void ep2_mul_lwnaf(ep2_t r, const ep2_t p, const bn_t k) {

#endif

#if EP_MUL == LWREG || !defined(STRIP)

void ep2_mul_lwreg(ep2_t r, const ep2_t p, const bn_t k) {
if (bn_is_zero(k) || ep2_is_infty(p)) {
ep2_set_infty(r);
Expand All @@ -634,8 +629,6 @@ void ep2_mul_lwreg(ep2_t r, const ep2_t p, const bn_t k) {
#endif
}

#endif

void ep2_mul_gen(ep2_t r, const bn_t k) {
if (bn_is_zero(k)) {
ep2_set_infty(r);
Expand Down

0 comments on commit 802ce0d

Please sign in to comment.