nothrow version(TBD)

update-fork
MITSUNARI Shigeo 4 years ago
parent 9b86774989
commit a145a2144a
  1. 2
      Makefile
  2. 12
      src/fp_generator.hpp

@ -372,7 +372,7 @@ ecdsa-wasm:
bin/emu:
$(CXX) -g -o $@ src/fp.cpp src/bn_c256.cpp test/bn_c256_test.cpp -DMCL_DONT_USE_XBYAK -DMCL_DONT_USE_OPENSSL -DMCL_USE_VINT -DMCL_SIZEOF_UNIT=8 -DMCL_VINT_64BIT_PORTABLE -DMCL_VINT_FIXED_BUFFER -DMCL_MAX_BIT_SIZE=256 -I./include
bin/pairing_c_min.exe: sample/pairing_c.c include/mcl/vint.hpp src/fp.cpp include/mcl/bn.hpp
$(CXX) -std=c++03 -O3 -g -fno-threadsafe-statics -fno-exceptions -fno-rtti -o $@ sample/pairing_c.c src/fp.cpp src/bn_c384_256.cpp -I./include -DMCL_DONT_USE_XBYAK -DMCL_DONT_USE_OPENSSL -DMCL_USE_VINT -DMCL_SIZEOF_UNIT=8 -DMCL_VINT_FIXED_BUFFER -DMCL_MAX_BIT_SIZE=384 -DMCL_VINT_64BIT_PORTABLE -DCYBOZU_DONT_USE_STRING -DCYBOZU_DONT_USE_EXCEPTION -DNDEBUG # -DMCL_DONT_USE_CSPRNG
$(CXX) -std=c++03 -O3 -g -fno-threadsafe-statics -fno-exceptions -fno-rtti -o $@ sample/pairing_c.c src/fp.cpp src/bn_c384_256.cpp -I./include -DXBYAK_NO_EXCEPTION -DMCL_DONT_USE_OPENSSL -DMCL_USE_VINT -DMCL_SIZEOF_UNIT=8 -DMCL_VINT_FIXED_BUFFER -DMCL_MAX_BIT_SIZE=384 -DMCL_VINT_64BIT_PORTABLE -DCYBOZU_DONT_USE_STRING -DCYBOZU_DONT_USE_EXCEPTION -DNDEBUG # -DMCL_DONT_USE_CSPRNG
make_tbl:
$(MAKE) ../bls/src/qcoeff-bn254.hpp

@ -78,7 +78,7 @@ struct MixPack {
}
void removeLast()
{
if (!size()) throw cybozu::Exception("MixPack:removeLast:empty");
assert(size());
if (mn > 0) {
mn--;
} else {
@ -248,6 +248,8 @@ struct FpGenerator : Xbyak::CodeGenerator {
reset(); // reset jit code for reuse
setProtectModeRW(); // read/write memory
init_inner(op);
// ToDo : recover op if false
if (Xbyak::GetError()) return false;
// printf("code size=%d\n", (int)getSize());
setProtectModeRE(); // set read/exec memory
return true;
@ -1822,9 +1824,7 @@ private:
*/
void sqr2(const Reg64& y3, const Reg64& y2, const Reg64& y1, const Reg64& y0, const Reg64& x1, const Reg64& x0, const Reg64& t1, const Reg64& t0)
{
if (!useMulx_) {
throw cybozu::Exception("sqr2:not support mulx");
}
assert(useMulx_);
mov(rdx, x0);
mulx(y1, y0, x0); // x0^2
mov(rdx, x1);
@ -1843,9 +1843,7 @@ private:
*/
void mul2x2(const RegExp& px, const RegExp& py, const Reg64& t4, const Reg64& t3, const Reg64& t2, const Reg64& t1, const Reg64& t0)
{
if (!useMulx_) {
throw cybozu::Exception("mul2x2:not support mulx");
}
assert(useMulx_);
#if 0
// # of add is less, but a little slower
mov(t4, ptr [py + 8 * 0]);

Loading…
Cancel
Save