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

move x1 to range {q/3 , ... , 2q/3} for create_commitments #2

Open
wants to merge 24 commits into
base: serde-type-name
Choose a base branch
from

Conversation

max-zengo
Copy link
Contributor

this change is following the update in Lindell'17 paper in the first message of P1

@max-zengo max-zengo requested a review from leontiadZen July 13, 2023 09:23
@max-zengo max-zengo marked this pull request as draft July 17, 2023 08:09
Copy link
Contributor

@leontiadZen leontiadZen left a 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());
Copy link
Contributor

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());
Copy link
Contributor

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 {
Copy link
Contributor

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

@leontiadZen leontiadZen marked this pull request as ready for review August 14, 2023 12:04
@leontiadZen leontiadZen changed the base branch from main to serde-type-name January 2, 2024 11:08
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

Successfully merging this pull request may close these issues.

2 participants