#[cfg(feature = "native")]
pub(crate) mod native;
#[cfg(feature = "api-led")]
impl core::ops::Not for crate::led::Status {
type Output = Self;
fn not(self) -> Self {
use crate::led::Status;
match self {
Status::Off => Status::On,
Status::On => Status::Off,
}
}
}
#[cfg(feature = "internal-api-crypto-hash")]
impl crate::crypto::hash::Algorithm {
pub const fn digest_len(self) -> usize {
match self {
crate::crypto::hash::Algorithm::Sha256 => 32,
crate::crypto::hash::Algorithm::Sha384 => 48,
}
}
}
#[cfg(feature = "api-crypto-ec")]
impl crate::crypto::ec::Curve {
pub const fn int_len(self) -> usize {
match self {
crate::crypto::ec::Curve::P256 => 32,
crate::crypto::ec::Curve::P384 => 48,
}
}
}
impl core::ops::Sub for crate::debug::Perf {
type Output = crate::debug::Perf;
fn sub(self, rhs: Self) -> Self::Output {
Self {
platform: self.platform - rhs.platform,
applets: self.applets - rhs.applets,
waiting: self.waiting - rhs.waiting,
}
}
}
impl core::ops::SubAssign for crate::debug::Perf {
fn sub_assign(&mut self, rhs: Self) {
self.platform -= rhs.platform;
self.applets -= rhs.applets;
self.waiting -= rhs.waiting;
}
}