define macro for emscripten

dev
MITSUNARI Shigeo 7 years ago
parent 1099498eb4
commit 229cc0166c
  1. 3
      include/mcl/gmp_util.hpp
  2. 4
      include/mcl/op.hpp
  3. 4
      include/mcl/vint.hpp
  4. 6
      test/bn_test.cpp

@ -22,6 +22,9 @@
#pragma warning(disable : 4512)
#pragma warning(disable : 4146)
#endif
#ifdef __EMSCRIPTEN__
#define MCL_USE_VINT
#endif
#ifdef MCL_USE_VINT
#include <mcl/vint.hpp>
typedef mcl::Vint mpz_class;

@ -11,6 +11,10 @@
#ifndef MCL_MAX_BIT_SIZE
#define MCL_MAX_BIT_SIZE 521
#endif
#ifdef __EMSCRIPTEN__
#define MCL_DONT_USE_XBYAK
#define MCL_DONT_USE_OPENSSL
#endif
#if !defined(MCL_DONT_USE_XBYAK) && (defined(_WIN64) || defined(__x86_64__))
#define MCL_USE_XBYAK
#endif

@ -14,6 +14,10 @@
#include <iostream>
#include <mcl/util.hpp>
#ifdef __EMSCRIPTEN__
#define MCL_VINT_64BIT_PORTABLE
#endif
#ifndef MCL_SIZEOF_UNIT
#if defined(CYBOZU_OS_BIT) && (CYBOZU_OS_BIT == 32)
#define MCL_SIZEOF_UNIT 4

@ -252,10 +252,10 @@ void testPairing(const G1& P, const G2& Q, const char *eStr)
Fp12 e = e1, ea;
G1 Pa;
G2 Qa;
#if MCL_SIZEOF_UNIT == 8
const int count = 1000;
#else
#if defined(__EMSCRIPTEN__) || MCL_SIZEOF_UNIT == 4
const int count = 100;
#else
const int count = 1000;
#endif
mpz_class a;
cybozu::XorShift rg;

Loading…
Cancel
Save