Skip to content

Commit

Permalink
forgot conditional compile flag
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Lodder <[email protected]>
  • Loading branch information
mikelodder7 committed Nov 1, 2023
1 parent 73ab30f commit 41689be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions curve25519-dalek/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ impl FieldElement {
FieldElement::sqrt_ratio_i(&FieldElement::ONE, self)
}

#[cfg(feature = "group")]
/// Handle 48 bytes like a big integer and reduce mod order
/// i.e. big_int(48 bytes) % p
/// but without using any reduce methods
Expand All @@ -317,17 +318,16 @@ impl FieldElement {
// and the 2nd half as the lo value
let mut arr = [0u8; 32];
for i in 0..24 {
arr[i] = bytes[23-i];
arr[i] = bytes[23 - i];
}
let mut hi = FieldElement::from_bytes(&arr);
for i in 0..24 {
arr[i] = bytes[47-i];
arr[i] = bytes[47 - i];
}
let lo = FieldElement::from_bytes(&arr);
hi *= &FieldElement::F_2_192;
&hi + &lo
}

}

#[cfg(test)]
Expand Down

0 comments on commit 41689be

Please sign in to comment.