|
|
@ -460,8 +460,11 @@ public: |
|
|
|
void setByCSPRNG(bool *pb, fp::RandGen rg = fp::RandGen()) |
|
|
|
void setByCSPRNG(bool *pb, fp::RandGen rg = fp::RandGen()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (rg.isZero()) rg = fp::RandGen::get(); |
|
|
|
if (rg.isZero()) rg = fp::RandGen::get(); |
|
|
|
rg.read(pb, v_, op_.N * sizeof(Unit)); // byte size
|
|
|
|
uint8_t x[sizeof(*this)]; |
|
|
|
|
|
|
|
const size_t n = op_.N * sizeof(Unit); |
|
|
|
|
|
|
|
rg.read(pb, x, n); // byte size
|
|
|
|
if (!pb) return; |
|
|
|
if (!pb) return; |
|
|
|
|
|
|
|
fp::convertArrayAsLE(v_, op_.N, x, n); |
|
|
|
setArrayMask(v_, op_.N); |
|
|
|
setArrayMask(v_, op_.N); |
|
|
|
} |
|
|
|
} |
|
|
|
#ifndef CYBOZU_DONT_USE_EXCEPTION |
|
|
|
#ifndef CYBOZU_DONT_USE_EXCEPTION |
|
|
|