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

element_random() return the same GT value #2

Closed
HuangMinming opened this issue Jun 12, 2024 · 1 comment
Closed

element_random() return the same GT value #2

HuangMinming opened this issue Jun 12, 2024 · 1 comment

Comments

@HuangMinming
Copy link

Hi,
I want to generate a random GT, and use the code below. However, every time I start the program, it return the same value. Is there any solution, thanks.
element_t m;
element_init_GT(m, pairing);
element_random(m);

@HuangMinming
Copy link
Author

I think there is a solution.
We can call sgx_read_rand() to generate a random, and call pbc_random_set_deterministic() to complete random set.
After that, element_random() will return different element every time.
I think pbc use /dev/urandom as the default seed which cause the problem. Because sgx could not open /dev/urandom.

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

1 participant