High-Performance Open-Source Archive
Load libraries that will be used.
Set some parameters.
Set a working seed for random numbers
Create the secret key and the polynomials a and e, which will go into the public key
# generate a secret key
s = GenSecretKey(n)
# generate a
a = GenA(n, q)
# generate the error
e = GenError(n)Generate the public key.
Create a polynomial message
Create polynomials for the encryption
Generate the ciphertext
Decrypt
decrypt = (ct1 * s) + ct0
decrypt = decrypt %% pm
decrypt = CoefMod(decrypt, q)
print(decrypt[1:length(coef(m))])
#> [1] 523 619 103
Need mirroring services?
Contact our team at info@vpspulse.com.
Mirror powered by VPSpulse
Infrastructure sponsored by VPSPulse & Secure Payments by ArionPay.