Skip to content

redc_param in README doesn match the code #119

Open
@themighty1

Description

@themighty1

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

👀 To Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions