We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have been trying to use the library but I get the error in the title. Here is the code I am using:
p, q, err := paillier.GenerateSafePrime( 1024, 4, 10000000000, rand.Reader, ) if err != nil { panic("DidierCrunchPaillier GenerateSafePrime error: " + err.Error()) } privateKey := paillier.CreatePrivateKey(p, q) toEncrypt := big.NewInt(19) cipher, err := privateKey.Encrypt(toEncrypt, rand.Reader) if err != nil { panic("DidierCrunchPaillier Encrypt error: " + err.Error()) } plain := privateKey.Decrypt(cipher) fmt.Println("Plaintext: " + plain.String())
The issue is with the decryption function. Here is the trace:
panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x0 pc=0x1033a3c] goroutine 1 [running]: math/big.(*Int).Mul(0xc00005fde8, 0xc00006c7c0, 0x0, 0x0) C:/Program Files/Go/src/math/big/int.go:168 +0x1dc github.com/didiercrunch/paillier.(*PrivateKey).Decrypt(0xc000104300, 0xc000148028, 0x0) C:/Users/eoztu/go/pkg/mod/github.com/didiercrunch/[email protected]/paillier.go:121 +0x1f9 ...
When I use small primes as in tests (e.g., 13, 17), enc/dec both works but not with generated primes. Am I using the API wrong?
The text was updated successfully, but these errors were encountered:
same issue
Sorry, something went wrong.
No branches or pull requests
I have been trying to use the library but I get the error in the title. Here is the code I am using:
The issue is with the decryption function. Here is the trace:
When I use small primes as in tests (e.g., 13, 17), enc/dec both works but not with generated primes. Am I using the API wrong?
The text was updated successfully, but these errors were encountered: