Skip to content
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

Elgamal Plaintext Range ? #17

Closed
fionser opened this issue May 24, 2018 · 3 comments
Closed

Elgamal Plaintext Range ? #17

fionser opened this issue May 24, 2018 · 3 comments

Comments

@fionser
Copy link

fionser commented May 24, 2018

  1. What is the plaintxt range of the Elgamal ? If the mcl::ecparam::secp160k1 is used, shoud the plaintext domain be 160-bits (i.e., 2^160) ?
  2. Should we need to cache all the elements in the plaintext range (the setCache method in the private key class), if we want to use Elgamal to do arithmetic computation ?
@herumi
Copy link
Owner

herumi commented May 28, 2018

What is the plaintxt range of the Elgamal? If the mcl::ecparam::secp160k1 is used, shoud the plaintext domain be 160-bits (i.e., 2^160) ?

Yes. But it is necessary to solve a small DLP to decrypt a message.
So we can not use large message space.
The range is set by PrivateKey::setCache(min, max);
It requires (max - min) * (sizeof(Ec) + alpha) memory.

Could you see elgamal_test.cpp? It is a small sample.

The implementation to solve a small DLP in mcl/she.hpp requires less memory instead of some computation, but it is not yet backported to ElGamal.

@fionser
Copy link
Author

fionser commented Jun 1, 2018

thx

@fionser fionser closed this as completed Jun 1, 2018
@herumi
Copy link
Owner

herumi commented Jun 2, 2018

@fionser
I added she::initG1only() to use secp160k1, secp192k1, etc.
Please see test of initG1only if you are interested in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants