Skip to content

Commit

Permalink
Increase NTT code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed May 12, 2022
1 parent eadc6a3 commit c5d930d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/fields/test_ntt.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_ntt_exceptions():
galois.ntt([1, 2, 3, 4], size=6.0)
with pytest.raises(TypeError):
galois.ntt([1, 2, 3, 4], modulus=3*256 + 1.0)
with pytest.raises(TypeError):
galois.ntt([1, 2, 3, 4], forward=1.0)

with pytest.raises(ValueError):
GF = galois.GF(2**8) # Invalid field for NTTs
Expand All @@ -32,6 +34,10 @@ def test_ntt_exceptions():
galois.ntt([1, 2, 3, 4], size=3)
with pytest.raises(ValueError):
galois.ntt([1, 2, 3, 40], modulus=13)
with pytest.raises(ValueError):
galois.ntt([1, 2, 3, 40], modulus=43)
with pytest.raises(ValueError):
galois.ntt([1, 2, 3, 4], modulus=3*256 + 2)


@pytest.mark.parametrize(["x", "p", "X"], NTT_LUTS)
Expand Down

0 comments on commit c5d930d

Please sign in to comment.