remove random_generator.hpp in bn_c_impl.hpp

dev
MITSUNARI Shigeo 7 years ago
parent 1e39f8caa4
commit 57fc4756ba
  1. 9
      src/bn_c_impl.hpp
  2. 1
      src/fp.cpp
  3. 6
      test/bn_c_test.hpp

@ -1,12 +1,5 @@
#define MCLBN_DLL_EXPORT
#include <mcl/bn.h>
#if 0 // #if CYBOZU_CPP_VERSION >= CYBOZU_CPP_VERSION_CPP11
#include <random>
static std::random_device g_rg;
#else
#include <cybozu/random_generator.hpp>
static cybozu::RandomGenerator g_rg;
#endif
#if MCLBN_FP_UNIT_SIZE == 4
#include <mcl/bn256.hpp>
@ -225,7 +218,7 @@ int mclBnFr_isOne(const mclBnFr *x)
int mclBnFr_setByCSPRNG(mclBnFr *x)
try
{
cast(x)->setRand(g_rg);
cast(x)->setByCSPRNG();
return 0;
} catch (std::exception& e) {
if (g_fp) fprintf(g_fp, "mclBnFr_setByCSPRNG %s\n", e.what());

@ -17,7 +17,6 @@
#endif
#include <cybozu/atoi.hpp>
#include <cybozu/itoa.hpp>
#include <cybozu/random_generator.hpp>
#include <mcl/randgen.hpp>
#ifdef _MSC_VER

@ -123,6 +123,12 @@ CYBOZU_TEST_AUTO(Fr)
CYBOZU_TEST_EQUAL(size, strlen(buf));
CYBOZU_TEST_ASSERT(!mclBnFr_setStr(&y, buf, size, 10));
CYBOZU_TEST_ASSERT(mclBnFr_isEqual(&x, &y));
for (int i = 0; i < 10; i++) {
mclBnFr_setByCSPRNG(&x);
mclBnFr_getStr(buf, sizeof(buf), &x, 16);
printf("%s\n", buf);
}
}
CYBOZU_TEST_AUTO(G1)

Loading…
Cancel
Save