field extension supposes non-fullbit

update-fork
MITSUNARI Shigeo 4 years ago
parent 9a3add8fe6
commit 28c8a0b489
  1. 1
      include/mcl/fp_tower.hpp
  2. 1
      test/fp_tower_test.cpp

@ -675,6 +675,7 @@ struct Fp2DblT {
void operator-=(const Fp2DblT& x) { sub(*this, *this, x); } void operator-=(const Fp2DblT& x) { sub(*this, *this, x); }
static void init() static void init()
{ {
assert(!Fp::getOp().isFullBit);
const mcl::fp::Op& op = Fp::getOp(); const mcl::fp::Op& op = Fp::getOp();
if (op.fp2Dbl_mulPreA_) { if (op.fp2Dbl_mulPreA_) {
mulPre = fp::func_ptr_cast<void (*)(Fp2DblT&, const Fp2&, const Fp2&)>(op.fp2Dbl_mulPreA_); mulPre = fp::func_ptr_cast<void (*)(Fp2DblT&, const Fp2&, const Fp2&)>(op.fp2Dbl_mulPreA_);

@ -401,6 +401,7 @@ void test(const char *p, mcl::fp::Mode mode)
const int xi_a = 1; const int xi_a = 1;
Fp::init(xi_a, p, mode); Fp::init(xi_a, p, mode);
printf("mode=%s\n", mcl::fp::ModeToStr(mode)); printf("mode=%s\n", mcl::fp::ModeToStr(mode));
if (Fp::getOp().isFullBit) return;
Fp2::init(); Fp2::init();
printf("bitSize=%d\n", (int)Fp::getBitSize()); printf("bitSize=%d\n", (int)Fp::getBitSize());
#if 0 #if 0

Loading…
Cancel
Save