4
$\begingroup$

I know that Elgamal algorithms have fallen out of fashion, and they are not included in any widespread cryptographic standard nowadays. However, they are still present in several popular crypto libraries (bouncy castle, botan, cryptopp, etc). One disturbing thing I found is that such libraries have no or very limited test vectors for Elgamal.

Do test vectors exist at all for Elgamal? What is a good reference? I especially refer to encryption and signing algorithms over $Z_p$.

$\endgroup$
2
$\begingroup$

There seem to be no standardized ElGamal test vectors available in the public domain. However, there are some ElGamal test vectors generated with libgcrypt 1.5.0 available in this fork of the pycrypto project.

$\endgroup$
1
$\begingroup$

I've created my own set of ElGamal test vectors of varying number of bits. I can't guarantee that they are correct, except that they pass my own implementation.

https://gist.github.com/devinrsmith/58926b3d62ccfe9818057f94d2c7189c

$\endgroup$
  • $\begingroup$ Just curious: how did you verify your own implementation without test vectors? Users might want to know to be able to assess if and how much they can trust your "random test vectors without guarantee of correctness". $\endgroup$ – e-sushi Sep 2 '17 at 0:30
  • $\begingroup$ It's a chicken and an egg problem! I found about 6 test vectors online though, either from existing implementations, or from small worked through examples. My implementation worked with those few test vectors. I'll add a comment to my gist as such. $\endgroup$ – dsmith Sep 2 '17 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.