Skip to content

Commit

Permalink
Merge pull request #94 from markcty/fix-panic-32bit
Browse files Browse the repository at this point in the history
Fix mgf1 panic in 32bit env
  • Loading branch information
blackbeam authored Jun 17, 2023
2 parents 0ac03d8 + a40dfd4 commit 23d3225
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/rsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl<T> Pkcs1OaepPadding<T> {
///
/// It will use SHA-1 as a hash function.
fn mgf1(seed: &[u8], len: usize) -> Vec<u8> {
if len > 2usize.pow(32) * Self::HASH_LEN {
if len as u64 > 2u64.pow(32) * Self::HASH_LEN as u64 {
panic!("mask too long");
}

Expand Down

0 comments on commit 23d3225

Please sign in to comment.