diff --git a/include/mcl/fp.hpp b/include/mcl/fp.hpp index 9303ddc..c9b1002 100644 --- a/include/mcl/fp.hpp +++ b/include/mcl/fp.hpp @@ -330,6 +330,7 @@ public: } /* mode = Mod : set x mod p if sizeof(S) * n <= 64 else error + set array x as little endian */ template void setArray(bool *pb, const S *x, size_t n, mcl::fp::MaskMode mode = fp::NoMask) @@ -346,6 +347,15 @@ public: fp::copyAndMask(v_, x, sizeof(S) * n, op_, fp::MaskAndMod); toMont(); } + /* + set (array mod p) + error if sizeof(S) * n > 64 + */ + template + void setArrayMod(bool *pb, const S *x, size_t n) + { + setArray(pb, x, n, fp::Mod); + } /* mask x with (1 << (bitLen - 1)) - 1 if x >= p