|
|
@ -330,6 +330,7 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
mode = Mod : set x mod p if sizeof(S) * n <= 64 else error |
|
|
|
mode = Mod : set x mod p if sizeof(S) * n <= 64 else error |
|
|
|
|
|
|
|
set array x as little endian |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
template<class S> |
|
|
|
template<class S> |
|
|
|
void setArray(bool *pb, const S *x, size_t n, mcl::fp::MaskMode mode = fp::NoMask) |
|
|
|
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); |
|
|
|
fp::copyAndMask(v_, x, sizeof(S) * n, op_, fp::MaskAndMod); |
|
|
|
toMont(); |
|
|
|
toMont(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
set (array mod p) |
|
|
|
|
|
|
|
error if sizeof(S) * n > 64 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
template<class S> |
|
|
|
|
|
|
|
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 |
|
|
|
mask x with (1 << (bitLen - 1)) - 1 if x >= p |
|
|
|