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

Usage of pow() #12

Open
calve opened this issue Jun 30, 2015 · 2 comments
Open

Usage of pow() #12

calve opened this issue Jun 30, 2015 · 2 comments

Comments

@calve
Copy link

calve commented Jun 30, 2015

Hello,

I did a quick review inside the code, and found the following
exponentiation = (long(x)**i) % prime
at https://github.com/onenameio/secret-sharing/blob/master/secretsharing/polynomials.py#L52

I wonder if there is any reason not to use Python's built-in pow(x,y,z) which is, according to the documentation

compute more efficiently than pow(x, y) % z

I thought about timing-attack on pow() but cannot find anything on the internet

@shea256
Copy link
Owner

shea256 commented Feb 10, 2016

Hi @calve thank you for submitting this.

I'm still unclear on why this other function is better. Can you explain further?

@calve
Copy link
Author

calve commented Feb 13, 2016

Hi, I would say the pow() function is better because it is in stdlib :)

As far as I know, there is no such thing as a cryptographically secure modular exponentiation, so I do not see any reason not to use the builtin.

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