Updating dependencies (#360)

This commit is contained in:
Kevin Lewi
2024-09-16 18:01:45 -07:00
committed by GitHub
parent 7eb363f571
commit 066f88f434
10 changed files with 17 additions and 37 deletions
+1 -15
View File
@@ -13,7 +13,7 @@ use generic_array::typenum::{U0, U2};
use generic_array::{ArrayLength, GenericArray};
use hmac::Mac;
use crate::errors::{InternalError, ProtocolError};
use crate::errors::ProtocolError;
// Corresponds to the I2OSP() function from RFC8017
pub(crate) fn i2osp<L: ArrayLength<u8>>(
@@ -154,20 +154,6 @@ impl<T: Mac> MacExt for T {
}
}
pub(crate) trait GenericArrayExt {
fn try_from_slice(slice: &[u8]) -> Result<&Self, InternalError>;
}
impl<L: ArrayLength<u8>> GenericArrayExt for GenericArray<u8, L> {
fn try_from_slice(slice: &[u8]) -> Result<&Self, InternalError> {
if slice.len() == L::USIZE {
Ok(Self::from_slice(slice))
} else {
Err(InternalError::InvalidByteSequence)
}
}
}
#[cfg(test)]
mod tests;