Skip to content

Commit

Permalink
Merge BoringSSL 'aa31748': Generate 64-bit Curve25519 and P256 code f…
Browse files Browse the repository at this point in the history
…or MSVC
  • Loading branch information
briansmith committed Sep 28, 2023
2 parents 5b32c4b + aa31748 commit 6e85944
Show file tree
Hide file tree
Showing 10 changed files with 4,093 additions and 813 deletions.
10 changes: 6 additions & 4 deletions crypto/curve25519/curve25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@
// Various pre-computed constants.
#include "./curve25519_tables.h"

#if defined(BORINGSSL_CURVE25519_64BIT)
#if defined(BORINGSSL_HAS_UINT128)
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
#include "../../third_party/fiat/curve25519_64.h"
#elif defined(OPENSSL_64_BIT)
#include "../../third_party/fiat/curve25519_64_msvc.h"
#else
#include "../../third_party/fiat/curve25519_32.h"
#endif // BORINGSSL_CURVE25519_64BIT
#endif


// Low-level intrinsic operations
Expand All @@ -75,7 +77,7 @@ static uint64_t load_4(const uint8_t *in) {

// Field operations.

#if defined(BORINGSSL_CURVE25519_64BIT)
#if defined(OPENSSL_64_BIT)

// assert_fe asserts that |f| satisfies bounds:
//
Expand Down Expand Up @@ -149,7 +151,7 @@ static uint64_t load_4(const uint8_t *in) {
} \
} while (0)

#endif // BORINGSSL_CURVE25519_64BIT
#endif // OPENSSL_64_BIT

OPENSSL_STATIC_ASSERT(sizeof(fe) == sizeof(fe_limb_t) * FE_NUM_LIMBS,
"fe_limb_t[FE_NUM_LIMBS] is inconsistent with fe");
Expand Down
Loading

0 comments on commit 6e85944

Please sign in to comment.