Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions k12_and_key_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,13 @@ static void table_lookup_fixed_base(point_precomp_t P, unsigned int digit, unsig
}
}

// MSVC (VC2022 17.14 specifically) does not strictly preserve left-to-right evaluation order.
// So turn off the optimization for 2 functions
// - multiply
// - Montgomery_multiply_mod_order
#ifdef _MSC_VER
#pragma optimize( "", off )
#endif
static void multiply(const unsigned long long* a, const unsigned long long* b, unsigned long long* c)
{
unsigned long long u, v, uv;
Expand Down Expand Up @@ -1343,6 +1350,10 @@ static void Montgomery_multiply_mod_order(const unsigned long long* ma, const un
}
}

#ifdef _MSC_VER
#pragma optimize( "", on )
#endif

static void eccnorm(point_extproj_t P, point_t Q)
{ // Normalize a projective point (X1:Y1:Z1), including full reduction

Expand Down