Skip to content

Commit

Permalink
MSVC fix for ec/native
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahbeckford committed Sep 19, 2023
1 parent f9075a4 commit d475557
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 10 deletions.
5 changes: 4 additions & 1 deletion ec/native/curve25519_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "curve25519_64.h"
#define WORD uint64_t
#define LIMBS 5
Expand Down
5 changes: 4 additions & 1 deletion ec/native/np224_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "np224_64.h"
#define LIMBS 4
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/np256_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "np256_64.h"
#define LIMBS 4
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/np384_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "np384_64.h"
#define LIMBS 6
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/np521_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "np521_64.h"
#define LIMBS 9
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/p224_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "p224_64.h"
#define LIMBS 4
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/p256_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "p256_64.h"
#define LIMBS 4
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/p384_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "p384_64.h"
#define LIMBS 6
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion ec/native/p521_stubs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "mirage_crypto.h"

#ifdef ARCH_64BIT
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined(ARCH_64BIT) && !defined(_MSC_VER)
#include "p521_64.h"
#define LIMBS 9
#define WORD uint64_t
Expand Down
5 changes: 4 additions & 1 deletion src/native/ghash_ctmul.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
#include "mirage_crypto.h"
#include <string.h>

#if defined (ARCH_32BIT)
/* Microsoft compiler does not support 128-bit integers. Drop down to
* 32-bit for MSVC.
*/
#if defined (ARCH_32BIT) || defined(_MSC_VER)

/*
* We cannot really autodetect whether multiplications are "slow" or
Expand Down

0 comments on commit d475557

Please sign in to comment.