-
Notifications
You must be signed in to change notification settings - Fork 8
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
move x1 to range {q/3 , ... , 2q/3} for create_commitments #2
base: serde-type-name
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments
src/party_one.rs
Outdated
|
||
while !Self::is_secret_share_in_range(&secret_share) { | ||
secret_share = ECScalar::new_random(); | ||
secret_share = ECScalar::from(&secret_share.to_big_int()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done in one line: secret_share = ECScalar::from(&ECScalar::new_random().to_big_int());
src/party_one.rs
Outdated
|
||
pub fn get_secret_share_in_range() -> FE { | ||
let mut secret_share: FE = ECScalar::new_random(); | ||
secret_share = ECScalar::from(&secret_share.to_big_int()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done in one line: secret_share = ECScalar::from(&ECScalar::new_random().to_big_int());
src/party_one.rs
Outdated
let secret_share: FE = | ||
ECScalar::from(&secret_share.to_big_int().div_floor(&BigInt::from(3))); | ||
//in Lindell's protocol range proof works only for x1 \in {q/3 , ... , 2q/3} | ||
pub fn is_secret_share_in_range(secret_share: &FE) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you have a look in sample_range
in curv and adapt your code, seems that is what we want
this change is following the update in Lindell'17 paper in the first message of P1