diff --git a/tests/fields/conftest.py b/tests/fields/conftest.py index 1b30fac64..a60645d0c 100644 --- a/tests/fields/conftest.py +++ b/tests/fields/conftest.py @@ -38,6 +38,7 @@ FIELDS_DIFF_MODES = [ # Binary field pytest.param("GF(2)-jit-calculate"), + pytest.param("GF(2)-python-calculate"), # Binary extension fields pytest.param("GF(2^2)-jit-lookup"), pytest.param("GF(2^2)-jit-calculate"), @@ -52,8 +53,10 @@ # Prime fields pytest.param("GF(5)-jit-lookup"), pytest.param("GF(5)-jit-calculate"), + pytest.param("GF(5)-python-calculate"), pytest.param("GF(7)-jit-lookup"), pytest.param("GF(7)-jit-calculate"), + pytest.param("GF(7)-python-calculate"), pytest.param("GF(31)-jit-lookup"), pytest.param("GF(31)-jit-calculate"), pytest.param("GF(3191)-jit-lookup"), @@ -76,7 +79,7 @@ def construct_field(folder): ufunc_mode = "auto" if folder == "GF(2)": - GF = galois.GF2 + GF = galois.GF(2, compile=ufunc_mode) elif folder == "GF(5)": GF = galois.GF(5, compile=ufunc_mode) diff --git a/tests/fields/test_arithmetic.py b/tests/fields/test_arithmetic.py index d0eb7e623..5465c8425 100644 --- a/tests/fields/test_arithmetic.py +++ b/tests/fields/test_arithmetic.py @@ -5,6 +5,7 @@ import random import numpy as np +import pytest import galois @@ -218,11 +219,12 @@ def test_log_different_base(field_log): assert np.array_equal(beta**z, x) -def test_log_pollard_rho(): +@pytest.mark.parametrize("ufunc_mode", ["jit-calculate", "python-calculate"]) +def test_log_pollard_rho(ufunc_mode): """ The Pollard-rho discrete logarithm algorithm is only applicable for fields when p^m - 1 is prime. """ - GF = galois.GF(2**19, compile="jit-calculate") + GF = galois.GF(2**5, compile=ufunc_mode) assert isinstance(GF._log, galois._domains._calculate.log_pollard_rho) dtype = random.choice(GF.dtypes) x = GF.Random(10, low=1, dtype=dtype)