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

Question about constant time exponentiation/multiplication #7

Closed
arybczak opened this issue Apr 18, 2017 · 5 comments
Closed

Question about constant time exponentiation/multiplication #7

arybczak opened this issue Apr 18, 2017 · 5 comments

Comments

@arybczak
Copy link
Contributor

Constant time version of these seems to be constant in a sense that it doesn't reveal information about particular bits of the input, but it does reveal information about the bitlength of input, i.e. multiplying a point from bn256::G1 by 42 is much faster than multiplying it by a "proper" 254bit scalar. I wonder if that can be a problem?

@herumi
Copy link
Owner

herumi commented Apr 18, 2017

The situation to use constant time version is multiplication by a secret number, then I think that the bit length of the number is known or almost same as the sizeof(Fr) so it is not necessary to hide the length. Is it wrong idea? then I'll fix it.

@herumi
Copy link
Owner

herumi commented Apr 19, 2017

Or I add the notification in the comments for mulCT. is it ok?

mcl/include/mcl/util.hpp

Lines 280 to 283 in 56811bb

/*
constant time pow
@note depends on bit length of y[n]
*/

@arybczak
Copy link
Contributor Author

The notification is nice to have.

Right, the secret itself will be large, but I've seen in a protocol multiplication by secret^-1 (in Fr) and it is not clear to me if that might be a potential issue (or if that's the exhaustive list of use of a transformed secret that might potentially be exploited).

@herumi
Copy link
Owner

herumi commented Apr 19, 2017

It is an interesting problem. #{L bit length number} = 2^(L-1).
Let the size of (1/s) be M bit (L > M), then the probability is 1 / 2^(L - M) and it might leak a little information.
I will modify that mulCT does not depend on the bit-length in the future.

@herumi
Copy link
Owner

herumi commented Jun 19, 2017

I will modify that mulCT does not depend on the bit-length in the future.

The latest version of mulCT does not depend on the bit-length.

@herumi herumi closed this as completed Jun 21, 2017
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