Skip to content

Commit

Permalink
Signing key generation works.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed May 30, 2024
1 parent 497470d commit c771582
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libcrux-ml-dsa/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ fn serialize_error_ring_element_when_eta_is_4<const BYTES_FOR_OUTPUT: usize>(
let mut serialized = [0u8; BYTES_FOR_OUTPUT];

for (i, coefficients) in re.coefficients.chunks_exact(2).enumerate() {
serialized[i] = ((coefficients[1] as u8) << 4) | (coefficients[0] as u8);
let coefficient0 = (4 - coefficients[0]) as u8;
let coefficient1 = (4 - coefficients[1]) as u8;
serialized[i] = (coefficient1 << 4) | coefficient0;
}

serialized
Expand Down

0 comments on commit c771582

Please sign in to comment.