(ctx)
| 8 | |
| 9 | @pytest.mark.parametrize("ctx", [helper_context_bfv(1024)]) |
| 10 | def test_batchencoder(ctx): |
| 11 | poly_modulus_degree = helper_poly_modulus_degree(ctx) |
| 12 | enc_out = sealapi.Plaintext() |
| 13 | |
| 14 | testcase = [1, 2, 3, 4, 5] |
| 15 | encoder = sealapi.BatchEncoder(ctx) |
| 16 | encoder.encode(testcase, enc_out) |
| 17 | assert enc_out.dyn_array().size() == poly_modulus_degree |
| 18 | assert encoder.decode_uint64(enc_out)[: len(testcase)] == testcase |
| 19 | assert encoder.decode_int64(enc_out)[: len(testcase)] == testcase |
| 20 | |
| 21 | |
| 22 | @pytest.mark.parametrize("testcase", [[10, 20, 30], [1 / div for div in range(2, 10)]]) |
nothing calls this directly
no test coverage detected