diff --git a/crates/scryptenc/src/params.rs b/crates/scryptenc/src/params.rs index 6f1c465..9085c01 100644 --- a/crates/scryptenc/src/params.rs +++ b/crates/scryptenc/src/params.rs @@ -38,8 +38,11 @@ impl Params { /// assert!(Params::new(ciphertext).is_ok()); /// ``` pub fn new(ciphertext: impl AsRef<[u8]>) -> Result { - let params = Header::parse(ciphertext.as_ref()).map(|h| h.params())?; - Ok(params) + let inner = |ciphertext: &[u8]| -> Result { + let params = Header::parse(ciphertext).map(|h| h.params())?; + Ok(params) + }; + inner(ciphertext.as_ref()) } /// Gets logâ‚‚ of the scrypt parameter `N`.