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

redc_param in README doesn match the code #119

Open
themighty1 opened this issue Feb 6, 2025 · 0 comments
Open

redc_param in README doesn match the code #119

themighty1 opened this issue Feb 6, 2025 · 0 comments

Comments

@themighty1
Copy link

Currently the README says:

`redc_param` is equal to `(1 << (2 * Params::modulus_bits())) / modulus` .

But in the code I see:
https://github.com/noir-lang/noir-bignum-paramgen/blob/8c3cb00c8498aebae596feab9273c73471907d7a/src/lib.rs#L26-L28

    let k = modulus.bits();
    let multiplicand = BigUint::new([1].to_vec()) << (k as usize * 2 + BARRETT_REDUCTION_OVERFLOW_BITS);
    let barrett_reduction_parameter: BigUint = (multiplicand) / modulus;

Which one is correct? Is + BARRETT_REDUCTION_OVERFLOW_BITS needed or is it optional?

@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Libraries Feb 6, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Status: 📋 Backlog
Development

No branches or pull requests

1 participant