Skip to content

Commit

Permalink
Attempt to fix the Windows msvc2017 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dkostic committed May 10, 2024
1 parent 4b5b472 commit e014623
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions crypto/fipsmodule/ec/ec_nistp.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ typedef struct {
void (*sqr)(ec_nistp_felem_limb *c, const ec_nistp_felem_limb *a);
} ec_nistp_felem_meth;

const ec_nistp_felem_meth *p256_felem_methods(void);
const ec_nistp_felem_meth *p384_felem_methods(void);
const ec_nistp_felem_meth *p521_felem_methods(void);

void ec_nistp_point_double(const ec_nistp_felem_meth *ctx,
ec_nistp_felem_limb *x_out,
Expand Down
2 changes: 1 addition & 1 deletion crypto/fipsmodule/ec/p256.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void fiat_p256_inv_square(fiat_p256_felem out,
fiat_p256_square(out, ret); // 2^256 - 2^224 + 2^192 + 2^96 - 2^2
}

DEFINE_LOCAL_DATA(ec_nistp_felem_meth, p256_felem_methods) {
DEFINE_METHOD_FUNCTION(ec_nistp_felem_meth, p256_felem_methods) {
out->add = fiat_p256_add;
out->sub = fiat_p256_sub;
out->mul = fiat_p256_mul;
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ec/p384.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ static void p384_inv_square(p384_felem out,
}

#if defined(EC_NISTP_USE_S2N_BIGNUM)
DEFINE_LOCAL_DATA(ec_nistp_felem_meth, p384_felem_methods) {
DEFINE_METHOD_FUNCTION(ec_nistp_felem_meth, p384_felem_methods) {
out->add = bignum_add_p384;
out->sub = bignum_sub_p384;
out->mul = bignum_montmul_p384_selector;
out->sqr = bignum_montsqr_p384_selector;
}
#else
DEFINE_LOCAL_DATA(ec_nistp_felem_meth, p384_felem_methods) {
DEFINE_METHOD_FUNCTION(ec_nistp_felem_meth, p384_felem_methods) {
out->add = fiat_p384_add;
out->sub = fiat_p384_sub;
out->mul = fiat_p384_mul;
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ec/p521.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ static void p521_felem_inv(p521_felem output, const p521_felem t1) {
}

#if defined(EC_NISTP_USE_S2N_BIGNUM)
DEFINE_LOCAL_DATA(ec_nistp_felem_meth, p521_felem_methods) {
DEFINE_METHOD_FUNCTION(ec_nistp_felem_meth, p521_felem_methods) {
out->add = bignum_add_p521;
out->sub = bignum_sub_p521;
out->mul = bignum_mul_p521_selector;
out->sqr = bignum_sqr_p521_selector;
}
#else
DEFINE_LOCAL_DATA(ec_nistp_felem_meth, p521_felem_methods) {
DEFINE_METHOD_FUNCTION(ec_nistp_felem_meth, p521_felem_methods) {
out->add = fiat_secp521r1_carry_add;
out->sub = fiat_secp521r1_carry_sub;
out->mul = fiat_secp521r1_carry_mul;
Expand Down

0 comments on commit e014623

Please sign in to comment.