[she] change define macro for parameter

dev
MITSUNARI Shigeo 7 years ago
parent 3a69196261
commit 6b6b7fd8b1
  1. 14
      include/mcl/she.hpp
  2. 8
      test/she_test.cpp

@ -18,26 +18,26 @@
#include <cmath>
#include <vector>
#include <iosfwd>
#if !defined(MCL_USE_BN256) && !defined(MCL_USE_BN384) && !defined(MCL_USE_BN512)
#define MCL_USE_BN256
#ifndef MCLBN_FP_UNIT_SIZE
#define MCLBN_FP_UNIT_SIZE 4
#endif
#ifdef MCL_USE_BN256
#if MCLBN_FP_UNIT_SIZE == 4
#include <mcl/bn256.hpp>
namespace mcl {
namespace bn_current = mcl::bn256;
}
#endif
#ifdef MCL_USE_BN384
#elif MCLBN_FP_UNIT_SIZE == 6
#include <mcl/bn384.hpp>
namespace mcl {
namespace bn_current = mcl::bn384;
}
#endif
#ifdef MCL_USE_BN512
#elif MCLBN_FP_UNIT_SIZE == 8
#include <mcl/bn512.hpp>
namespace mcl {
namespace bn_current = mcl::bn512;
}
#else
#error "MCLBN_FP_UNIT_SIZE must be 4, 6, or 8"
#endif
#if CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11

@ -11,13 +11,11 @@ SecretKey g_sec;
CYBOZU_TEST_AUTO(log)
{
#ifdef MCL_USE_BN256
#if MCLBN_FP_UNIT_SIZE == 4
const mcl::bn::CurveParam& cp = mcl::bn::CurveFp254BNb;
#endif
#ifdef MCL_USE_BN384
#elif MCLBN_FP_UNIT_SIZE == 6
const mcl::bn::CurveParam& cp = mcl::bn::CurveFp382_1;
#endif
#ifdef MCL_USE_BN512
#elif MCLBN_FP_UNIT_SIZE == 8
const mcl::bn::CurveParam& cp = mcl::bn::CurveFp462;
#endif
SHE::init(cp);

Loading…
Cancel
Save