diff --git a/src/algorithms/oaep.rs b/src/algorithms/oaep.rs index 6ac1f027..0b9693c5 100644 --- a/src/algorithms/oaep.rs +++ b/src/algorithms/oaep.rs @@ -162,9 +162,9 @@ where return Err(Error::Decryption); } - let (out, index) = res.unwrap(); + let index = res.unwrap(); - Ok(out[index as usize..].to_vec()) + Ok(em[index as usize..].to_vec()) } ///Decrypts OAEP padding. @@ -205,9 +205,9 @@ where return Err(Error::Decryption); } - let (out, index) = res.unwrap(); + let index = res.unwrap(); - Ok(out[index as usize..].to_vec()) + Ok(em[index as usize..].to_vec()) } /// Decrypts OAEP padding. It returns one or zero in valid that indicates whether the @@ -219,7 +219,7 @@ fn decrypt_inner( expected_p_hash: &[u8], k: usize, mut mgf: MGF, -) -> Result, u32)>> { +) -> Result> { if k < 11 { return Err(Error::Decryption); } @@ -256,8 +256,5 @@ fn decrypt_inner( let valid = first_byte_is_zero & hash_are_equal & !nonzero_before_one & !looking_for_index; - Ok(CtOption::new( - (em.to_vec(), index + 2 + (h_size * 2) as u32), - valid, - )) + Ok(CtOption::new(index + 2 + (h_size * 2) as u32, valid)) }