From 802ce0df190567d80306239dc5c75fda70a98c37 Mon Sep 17 00:00:00 2001 From: "Diego F. Aranha" Date: Mon, 27 Jan 2025 10:03:05 +0100 Subject: [PATCH] Some fixes to STRIP support. --- include/relic_ed.h | 2 -- src/ep/relic_ep_map.c | 4 ++-- src/ep/relic_ep_mul.c | 2 -- src/ep/relic_ep_mul_cof.c | 2 ++ src/epx/relic_ep2_mul.c | 7 ------- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/relic_ed.h b/include/relic_ed.h index b741ebef2..1ca21fc9a 100644 --- a/include/relic_ed.h +++ b/include/relic_ed.h @@ -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; diff --git a/src/ep/relic_ep_map.c b/src/ep/relic_ep_map.c index acae80436..c4f72cea3 100644 --- a/src/ep/relic_ep_map.c +++ b/src/ep/relic_ep_map.c @@ -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); diff --git a/src/ep/relic_ep_mul.c b/src/ep/relic_ep_mul.c index 692035db5..1c965db50 100644 --- a/src/ep/relic_ep_mul.c +++ b/src/ep/relic_ep_mul.c @@ -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) { @@ -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 */ diff --git a/src/ep/relic_ep_mul_cof.c b/src/ep/relic_ep_mul_cof.c index a0dd8f5e6..f69415f43 100644 --- a/src/ep/relic_ep_mul_cof.c +++ b/src/ep/relic_ep_mul_cof.c @@ -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); diff --git a/src/epx/relic_ep2_mul.c b/src/epx/relic_ep2_mul.c index 6ccb28655..6732bfa08 100644 --- a/src/epx/relic_ep2_mul.c +++ b/src/epx/relic_ep2_mul.c @@ -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; @@ -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) @@ -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); @@ -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);