Skip to content

Commit

Permalink
Removed useless normalization (cosmetic).
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Pornin committed Jun 3, 2024
1 parent 09b403d commit 00e0b78
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/backend/w64/gfp256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,6 @@ impl GFp256 {
let z16 = z8.xsquare(8) * z8;
let z32 = z16.xsquare(16) * z16;
let mut y = ((z32.xsquare(32) * z).xsquare(96) * z).xsquare(94);
y.set_normalized();

// Normalize y and negate it if necessary to set the low bit to 0.
y.set_normalized();
Expand Down Expand Up @@ -1367,8 +1366,7 @@ impl GFp256 {
}

// Encode this value over exactly 32 bytes. Encoding is always canonical
// (little-endian encoding of the value in the 0..q-1 range, top bit
// of the last byte is always 0).
// (little-endian encoding of the value in the 0..q-1 range).
#[inline(always)]
pub fn encode32(self) -> [u8; 32] {
let mut r = self;
Expand All @@ -1382,8 +1380,7 @@ impl GFp256 {
}

// Encode this value over exactly 32 bytes. Encoding is always canonical
// (little-endian encoding of the value in the 0..q-1 range, top bit
// of the last byte is always 0).
// (little-endian encoding of the value in the 0..q-1 range).
#[inline(always)]
pub fn encode(self) -> [u8; 32] {
self.encode32()
Expand Down

0 comments on commit 00e0b78

Please sign in to comment.