Skip to content

Commit

Permalink
Fix size of otstype
Browse files Browse the repository at this point in the history
`otstype` is converted as a `u32` below, panics if it is `ID_LEN` (16) bytes long. With this change, the `SigningKey` can be correctly converted to bytes and back.
  • Loading branch information
davidthomaswood authored Nov 6, 2024
1 parent 8f93676 commit 9e97218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lms/src/lms/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<'a, Mode: LmsMode> TryFrom<&'a [u8]> for SigningKey<Mode> {
Ordering::Greater => Err(LmsDeserializeError::TooLong),
Ordering::Equal => {
// pk is now guaranteed to be of the form otstype || q || id || seed
let (otstype, qk) = pk.split_at(ID_LEN);
let (otstype, qk) = pk.split_at(4);
let (q, idseed) = qk.split_at(4);
let (id, seed) = idseed.split_at(ID_LEN);

Expand Down

0 comments on commit 9e97218

Please sign in to comment.