Better error-message when okm_len > MAX
@@ -40,7 +40,8 @@ impl Hkdf {
pub fn hkdf_expand(&self, prk: &[u8], info: &[u8], okm_len: usize) -> Vec<u8> {
if okm_len as f32 > 255_f32 * self.hash_return_size() as f32 {
- panic!("Length is too high.");
+ panic!("Derived key length above max. Max derived key length is: {:?}",
+ 255_f32 * self.hash_return_size() as f32);
}
let n_iter = (okm_len as f32 / self.hash_return_size() as f32).ceil() as usize;
