@@ -126,27 +126,6 @@ static const p521_limb_t p521_felem_p[P521_NLIMBS] = {
126
126
127
127
#endif // EC_NISTP_USE_S2N_BIGNUM
128
128
129
- // The wrapper functions are needed for FIPS static build.
130
- // Otherwise, initializing ec_nistp_meth with pointers to s2n-bignum
131
- // functions directly generates :got: references that are also thought
132
- // to be local_target by the delocator.
133
- static inline void p521_felem_add_wrapper (ec_nistp_felem_limb * c ,
134
- const ec_nistp_felem_limb * a ,
135
- const ec_nistp_felem_limb * b ) {
136
- p521_felem_add (c , a , b );
137
- }
138
-
139
- static inline void p521_felem_sub_wrapper (ec_nistp_felem_limb * c ,
140
- const ec_nistp_felem_limb * a ,
141
- const ec_nistp_felem_limb * b ) {
142
- p521_felem_sub (c , a , b );
143
- }
144
-
145
- static inline void p521_felem_neg_wrapper (ec_nistp_felem_limb * c ,
146
- const ec_nistp_felem_limb * a ) {
147
- p521_felem_opp (c , a );
148
- }
149
-
150
129
static p521_limb_t p521_felem_nz (const p521_limb_t in1 [P521_NLIMBS ]) {
151
130
p521_limb_t is_not_zero = 0 ;
152
131
for (int i = 0 ; i < P521_NLIMBS ; i ++ ) {
@@ -310,11 +289,11 @@ static void p521_point_add(p521_felem x3, p521_felem y3, p521_felem z3,
310
289
DEFINE_METHOD_FUNCTION (ec_nistp_meth , p521_methods ) {
311
290
out -> felem_num_limbs = P521_NLIMBS ;
312
291
out -> felem_num_bits = 521 ;
313
- out -> felem_add = p521_felem_add_wrapper ;
314
- out -> felem_sub = p521_felem_sub_wrapper ;
292
+ out -> felem_add = bignum_add_p521 ;
293
+ out -> felem_sub = bignum_sub_p521 ;
315
294
out -> felem_mul = bignum_mul_p521_selector ;
316
295
out -> felem_sqr = bignum_sqr_p521_selector ;
317
- out -> felem_neg = p521_felem_neg_wrapper ;
296
+ out -> felem_neg = bignum_neg_p521 ;
318
297
out -> felem_nz = p521_felem_nz ;
319
298
out -> felem_one = p521_felem_one ;
320
299
out -> point_dbl = p521_point_double ;
0 commit comments