Skip to content

Commit c13dff5

Browse files
committed
repeatable normal element in initNormalBasisMatrix
1 parent 2e6f0a4 commit c13dff5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/EncryptedArray.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,17 @@ void EncryptedArrayDerived<type>::decode(NewPlaintextArray& array, const NTL::Ve
378378
}
379379

380380

381-
// this routine generates a random normal element
382-
// and initializes a matrix mapping from polynomial to
383-
// normal basis and its inverse.
381+
// this routine generates a "random" normal element and initializes a
382+
// matrix mapping from polynomial to normal basis and its inverse. It
383+
// uses a randomized algorithm to find the normal basis, but we init
384+
// the PRG seed deterministically to ensure that we always get the
385+
// same one (for a given set of parameters)
384386

385387
template<class type>
386388
void EncryptedArrayDerived<type>::initNormalBasisMatrix() const
387389
{
390+
RandomState state;
391+
SetSeed(to_ZZ(1));
388392
do {
389393
typename Lazy< Pair< Mat<R>, Mat<R> > >::Builder
390394
builder(normalBasisMatrices);

0 commit comments

Comments
 (0)