Open radwasherif opened 7 years ago
You seem to be encrypting relative to one key, but then generating a totally new key (cf. the secretKey.GenSecKey(64)
in the second part). Trying to decrypt with this new key, you should not expect to get the right answer. Are you sure the first scheme decrypts correctly? It really should not, as far as I can tell.
I have the following code to initialize multiple schemes in HElib, encrypt some values using each scheme, then write the scheme, public key and Ctxt's out to a file:
Then I have the following code to read each scheme and it's public key, then initiate a secret key. Then it reads the Ctxt's from their respective files and decrypts them:
But only the first scheme decrypts correctly. For the other two, I am getting random values modulo p. I cannot detect a pattern in them. What could be the problem?