throws NtruException
{
for (int t=0; t<tests.length; t++)
{
KeyParams keyParams = KeyParams.getKeyParams(tests[t].oid);
FullPolynomial f = new FullPolynomial(tests[t].f);
// get f into the expected form:
// The test vectors have coefficients of f in [0..q-1]
// recoverF expects them in the range [-q/2..q/2)
for (int i=0; i<f.p.length; i++)
{
if (f.p[i] > keyParams.q)
f.p[i] %= keyParams.q;
if (f.p[i] > keyParams.q/2)
f.p[i] -= keyParams.q;
}
FullPolynomial F = new FullPolynomial(tests[t].F);
FullPolynomial Fret = KeyFormatterUtil.recoverF(f);
assertTrue(Arrays.equals(F.p, Fret.p));
}
}