mirror of https://github.com/zcash/orchard.git
Ensure lo and hi incomplete ranges line up
The previous code assumed that `pallas::Scalar::NUM_BITS` was odd, which is true, but might not remain so after a future generalisation refactor.
This commit is contained in:
parent
a09173a331
commit
a38e2ff728
|
@ -43,8 +43,8 @@ const INCOMPLETE_HI_LEN: usize = INCOMPLETE_LEN / 2;
|
||||||
|
|
||||||
// Bits k_{254} to k_{4} inclusive are used in incomplete addition.
|
// Bits k_{254} to k_{4} inclusive are used in incomplete addition.
|
||||||
// The `lo` half is k_{129} to k_{4} inclusive (length 126 bits).
|
// The `lo` half is k_{129} to k_{4} inclusive (length 126 bits).
|
||||||
const INCOMPLETE_LO_RANGE: Range<usize> = (INCOMPLETE_LEN / 2)..INCOMPLETE_LEN;
|
const INCOMPLETE_LO_RANGE: Range<usize> = INCOMPLETE_HI_LEN..INCOMPLETE_LEN;
|
||||||
const INCOMPLETE_LO_LEN: usize = (INCOMPLETE_LEN / 2) + 1;
|
const INCOMPLETE_LO_LEN: usize = INCOMPLETE_LEN - INCOMPLETE_HI_LEN;
|
||||||
|
|
||||||
// Bits k_{3} to k_{1} inclusive are used in complete addition.
|
// Bits k_{3} to k_{1} inclusive are used in complete addition.
|
||||||
// Bit k_{0} is handled separately.
|
// Bit k_{0} is handled separately.
|
||||||
|
|
Loading…
Reference in New Issue