-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using smaller key sizes and adjusting the calculation #133
Comments
also - what best way to generate the public key, from a secret key? |
You could try lowering the bitSize in: const heConfig = {
keySize: 4096,
bitSize: 20 // lower to 17 or 16 when using PolyModulusDegree < 4096
} I'm not sure what the contents of your ciphers contain or why you're using multiple ciphertexts (not that it's incorrect to do so, but changes the context of what you can do). If you're using batching (storing PolyModulusDegree number of values in each of the ciphertexts - i.e. 4096 values when using polyModDegree of 4096), there is a sumElements function that will sum all items in a single ciphertext. It does require you to generate Regarding public key generation, you should always create the |
hey so I am very close to something that now works fully which I'm really pleased with. To be honest, most of the work has been converting 2D arrays to 1D arrays.
The one last thing I'm experiencing is:
In this case the first line prints: kernels length 114
If I use
then I get the correct value after I decrypt. However
2048
or1024
gives me garbage out. My thinking is my multiplyPlain and add are resulting in too much entropy in the data and its causing garbage when I decrypt. My initial thinking is I am applying too many calculations to the encryptedFillArray (my final resulting array for each iteration) and its becoming a load of mess when the keySize is too small - I think tmp will not be the problem here.What options do I have to allow myself to use smaller key sizes?
my first guess is relinearize but I think the galois keys are very big and I'd rather not send one over the wire, so then I thought could I create an array of encryptFillArray[...]s and then add them back together afterwards or something, rather than apply the maths on the same one again and again?
The reason I want to use smaller key sizes is because I want to send the base64 exported cipher texts (
.save()
) over HTTP and smaller key sizes means smaller amounts of data to send.also...
UJNRELATED:
Final and unrelated question, I'm actually trying to calculate the average - I need to end up with the multiplication of each value, then sum them and divide by the number of values in kernels[x], but I am not sure how to do that in a 1D array - i.e choosing the correct elements (only a subset of the values in the cipherText array) and secondly I am not sure if I can do division at all (even multiply by inverse....?) so that I end up with 1 value rather than kernels[j].length values (i'm doing gaussian blur on the data which is an average. I may have to do this part after decryption I suspect...?
Thanks!
The text was updated successfully, but these errors were encountered: