| 71 | |
| 72 | |
| 73 | def test_modulus_sanity(): |
| 74 | custom_mod = sealapi.CoeffModulus.Create(1024, [32, 32]) |
| 75 | assert len(custom_mod) == 2 |
| 76 | for small_mod in custom_mod: |
| 77 | assert small_mod.is_prime() is True |
| 78 | |
| 79 | small_mod = sealapi.PlainModulus.Batching(1024, 40) |
| 80 | assert small_mod.is_prime() is True |
| 81 | assert small_mod.bit_count() == 40 |
| 82 | |
| 83 | sizes = [16, 32, 40] |
| 84 | small_mods = sealapi.PlainModulus.Batching(1024, sizes) |
| 85 | for idx, small_mod in enumerate(small_mods): |
| 86 | assert small_mod.bit_count() == sizes[idx] |
| 87 | |
| 88 | |
| 89 | @pytest.mark.parametrize( |