Open Pro7ech opened 1 month ago
Hey, this seems to be an API issue as it is not documented what happens if the plaintext modulus t
does not respect t = 1 (mod 2N)
.
Internally, the current implementation will find a ring degree for the T
polynomial that abides by this rule. In the snippet t = 257
, the largest ring degree that accommodates this choice is 128
which is also the number of slots available. As a result, params.N()
does not correspond to the actual number of slots available.
For example see, testEncoder
in schemes/bgv/bgv_test.go
which handles this case correctly.
If batching is set to false, it should be possible to encode N
values modulo a any t
since this doesn't require to call a DFT/IDFT.
What version of Lattigo are you using?
v5.0.2
Does this issue persist with the latest release?
yes
What were you trying to do?
Encode
params.N()
values with the flagIsBatched=false
What were you expecting to happen?
No error
What actually happened?
panic: cannot Encode (TimeDomain): len(values)=16384 > N=128
Reproducibility