use super::{AuthEncSpec, AuthSpec, EncSpec};
use core::fmt::{Debug, Formatter};
use hybrid_array::Array;
pub struct EncParams<E: EncSpec> {
pub key: Array<u8, E::KeySize>,
pub iv: Array<u8, E::IvSize>,
}
impl<E: EncSpec> Debug for EncParams<E> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("EncParams").field("key", &"***").field("iv", &self.iv).finish()
}
}
pub struct AuthParams<A: AuthSpec> {
pub key: Array<u8, A::KeySize>,
}
impl<A: AuthSpec> Debug for AuthParams<A> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("AuthParams").field("key", &"***").finish()
}
}
pub struct AuthEncParams<AE: AuthEncSpec> {
pub key: Array<u8, AE::KeySize>,
pub iv: Array<u8, AE::IvSize>,
}
impl<AE: AuthEncSpec> Debug for AuthEncParams<AE> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("AuthEncParams").field("key", &"***").field("iv", &self.iv).finish()
}
}
pub trait WithKeySize: super::sealed::Sealed {
type KeySize;
}
impl<E: EncSpec> super::sealed::Sealed for EncParams<E> {}
impl<E: EncSpec> WithKeySize for EncParams<E> {
type KeySize = E::KeySize;
}
impl<A: AuthSpec> super::sealed::Sealed for AuthParams<A> {}
impl<A: AuthSpec> WithKeySize for AuthParams<A> {
type KeySize = A::KeySize;
}
impl<AE: AuthEncSpec> super::sealed::Sealed for AuthEncParams<AE> {}
impl<AE: AuthEncSpec> WithKeySize for AuthEncParams<AE> {
type KeySize = AE::KeySize;
}