private void EncodeDecodeModQ() { int[] coeffs = PolynomialGeneratorForTesting.generateRandomPositive(1000, 2048).Coeffs; byte[] data = ArrayEncoder.EncodeModQ(coeffs, 2048); int[] coeffs2 = ArrayEncoder.DecodeModQ(data, 1000, 2048); if (!Compare.AreEqual(coeffs, coeffs2)) { throw new Exception("ArrayEncoder EncodeDecodeModQ test failed!"); } }
private void EncodeDecodeMod3Tight() { int[] coeffs = PolynomialGeneratorForTesting.generateRandom(1000).Coeffs; byte[] data = ArrayEncoder.EncodeMod3Tight(coeffs); int[] coeffs2 = ArrayEncoder.DecodeMod3Tight(data, 1000); if (!Compare.AreEqual(coeffs, coeffs2)) { throw new Exception("ArrayEncoder EncodeDecodeMod3Tight test failed!"); } }