Skip to content

Commit 8434e5c

Browse files
Add comment
1 parent 65a25dd commit 8434e5c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

extensions/ecc/guest/src/eddsa.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ where
194194
{
195195
let mut y_bytes = p.y().as_le_bytes().to_vec();
196196
if p.x().as_le_bytes()[0] & 1u8 == 1 {
197+
// We pack the parity of the x-coordinate in the most significant bit of the last byte, as
198+
// per the Ed25519 spec, so the Coordinate<C> type must have enough limbs so that the most
199+
// significant bit of the last byte is always 0.
197200
debug_assert!(y_bytes[Coordinate::<C>::NUM_LIMBS - 1] & 0b10000000 == 0);
198201
y_bytes[Coordinate::<C>::NUM_LIMBS - 1] |= 0b10000000;
199202
}

0 commit comments

Comments
 (0)