SEAL
SEAL copied to clipboard
How to calculate Polynomial Multiplication?
a=2x^0+x+4x^6,
b=5x^0+6x,
a*b=10x^0+17x+6x^2+20x^6+36x^7,
How to directly calculate the coefficient of a*b by the SEAL?
There is no direct way. You first have to encode the polynomials with the batchencoder. This way you will create a plaintext. Afterwards, you have to encrypt it with the encryptor.encrypt(-) function and you will get a ciphertext. Later on you have to use the multiplication function in the file evaluator.h such as evalutator.multiply_inplace(-). Finally, you just have to decrypt the result and decode it. For a better understading of this library I recommend you to look at the examples in /native/examples.
- The poly degree
N, and the moduloqtogether define the polynomial ringZZ_q[X]/(X^N + 1) - We need
q = 1 mod 2Nfor fast poly multiplication. - Then we can use
seal/util/ntt.hto compute the poly mul ie.,a * b = c mod (X^N + 1, q)