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 Aug 27, 2021
1 parent ac7883b commit 5586571
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 9 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
3 changes: 3 additions & 0 deletions src/native/ghash_ctmul.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#include "mirage_crypto.h"
#include <string.h>

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

/*
Expand Down

0 comments on commit 5586571

Please sign in to comment.