From 980c182913ce6abf80627001429cd88dfaecfdf1 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Tue, 21 Jun 2016 10:41:10 +0900 Subject: [PATCH] test addNC256 --- test/low_test.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/low_test.cpp diff --git a/test/low_test.cpp b/test/low_test.cpp new file mode 100644 index 0000000..bfca6ec --- /dev/null +++ b/test/low_test.cpp @@ -0,0 +1,24 @@ +#define MCL_USE_LLVM +#include +#include +#include "../src/fp_proto.hpp" +#include "../src/low_gmp.hpp" + +cybozu::XorShift rg; + +CYBOZU_TEST_AUTO(addNC) +{ + using namespace mcl::fp; + const size_t N = 256 / UnitBitSize; + Unit x[N], y[N]; + for (int i = 0; i < 10; i++) { + Unit z[N]; + Unit w[N]; + rg.read(x, N); + rg.read(y, N); + low_add(z, x, y); + mcl_fp_addNC256(w, x, y); + CYBOZU_TEST_EQUAL_ARRAY(z, w, N); + } +} +