Skip to content

Commit 77be042

Browse files
committed
Revert "attempt delocator fix"
This reverts commit 3ba67cb.
1 parent 3ba67cb commit 77be042

File tree

2 files changed

+6
-47
lines changed

2 files changed

+6
-47
lines changed

crypto/fipsmodule/ec/p384.c

+3-23
Original file line numberDiff line numberDiff line change
@@ -83,26 +83,6 @@ static p384_limb_t p384_felem_nz(const p384_limb_t in1[P384_NLIMBS]) {
8383

8484
#endif // EC_NISTP_USE_S2N_BIGNUM
8585

86-
// The wrapper functions are needed for FIPS static build.
87-
// Otherwise, initializing ec_nistp_meth with pointers to s2n-bignum
88-
// functions directly generates :got: references that are also thought
89-
// to be local_target by the delocator.
90-
static inline void p384_felem_add_wrapper(ec_nistp_felem_limb *c,
91-
const ec_nistp_felem_limb *a,
92-
const ec_nistp_felem_limb *b) {
93-
p384_felem_add(c, a, b);
94-
}
95-
96-
static inline void p384_felem_sub_wrapper(ec_nistp_felem_limb *c,
97-
const ec_nistp_felem_limb *a,
98-
const ec_nistp_felem_limb *b) {
99-
p384_felem_sub(c, a, b);
100-
}
101-
102-
static inline void p384_felem_neg_wrapper(ec_nistp_felem_limb *c,
103-
const ec_nistp_felem_limb *a) {
104-
p384_felem_opp(c, a);
105-
}
10686

10787
static void p384_from_generic(p384_felem out, const EC_FELEM *in) {
10888
#ifdef OPENSSL_BIG_ENDIAN
@@ -293,11 +273,11 @@ static void p384_point_add(p384_felem x3, p384_felem y3, p384_felem z3,
293273
DEFINE_METHOD_FUNCTION(ec_nistp_meth, p384_methods) {
294274
out->felem_num_limbs = P384_NLIMBS;
295275
out->felem_num_bits = 384;
296-
out->felem_add = p384_felem_add_wrapper;
297-
out->felem_sub = p384_felem_sub_wrapper;
276+
out->felem_add = bignum_add_p384;
277+
out->felem_sub = bignum_sub_p384;
298278
out->felem_mul = bignum_montmul_p384_selector;
299279
out->felem_sqr = bignum_montsqr_p384_selector;
300-
out->felem_neg = p384_felem_neg_wrapper;
280+
out->felem_neg = bignum_neg_p384;
301281
out->felem_nz = p384_felem_nz;
302282
out->felem_one = p384_felem_one;
303283
out->point_dbl = p384_point_double;

crypto/fipsmodule/ec/p521.c

+3-24
Original file line numberDiff line numberDiff line change
@@ -126,27 +126,6 @@ static const p521_limb_t p521_felem_p[P521_NLIMBS] = {
126126

127127
#endif // EC_NISTP_USE_S2N_BIGNUM
128128

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-
150129
static p521_limb_t p521_felem_nz(const p521_limb_t in1[P521_NLIMBS]) {
151130
p521_limb_t is_not_zero = 0;
152131
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,
310289
DEFINE_METHOD_FUNCTION(ec_nistp_meth, p521_methods) {
311290
out->felem_num_limbs = P521_NLIMBS;
312291
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;
315294
out->felem_mul = bignum_mul_p521_selector;
316295
out->felem_sqr = bignum_sqr_p521_selector;
317-
out->felem_neg = p521_felem_neg_wrapper;
296+
out->felem_neg = bignum_neg_p521;
318297
out->felem_nz = p521_felem_nz;
319298
out->felem_one = p521_felem_one;
320299
out->point_dbl = p521_point_double;

0 commit comments

Comments
 (0)