Skip to content

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

Open
max-zengo wants to merge 24 commits intoserde-type-namefrom
party1-msg1-rand-range
Open

move x1 to range {q/3 , ... , 2q/3} for create_commitments#2
max-zengo wants to merge 24 commits intoserde-type-namefrom
party1-msg1-rand-range

Conversation

@max-zengo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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