Skip to content

Commit

Permalink
Add missing len_in_bytes check to ExpandMsgXmd::init_expand
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Jul 21, 2024
1 parent eb3f0a9 commit cf264e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hash_to_curve/expand_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ where
if ell > 255 {
panic!("Invalid ExpandMsgXmd usage: ell > 255");
}
if len_in_bytes > u16::MAX as usize {
panic!("Invalid ExpandMsgXmd usage: len_in_bytes > u16::MAX");
}

let dst = ExpandMsgDst::for_xmd::<H>(dst);
let mut hash_b_0 =
H::default().chain(GenericArray::<u8, <H as BlockInput>::BlockSize>::default());
Expand Down

0 comments on commit cf264e6

Please sign in to comment.