wasefire_applet_api/
wasm.rs1#[cfg(feature = "native")]
16pub(crate) mod native;
17
18#[cfg(feature = "api-led")]
19impl core::ops::Not for crate::led::Status {
20 type Output = Self;
21 fn not(self) -> Self {
22 use crate::led::Status;
23 match self {
24 Status::Off => Status::On,
25 Status::On => Status::Off,
26 }
27 }
28}
29
30#[cfg(feature = "internal-api-crypto-hash")]
31impl crate::crypto::hash::Algorithm {
32 pub const fn digest_len(self) -> usize {
34 match self {
35 crate::crypto::hash::Algorithm::Sha256 => 32,
36 crate::crypto::hash::Algorithm::Sha384 => 48,
37 }
38 }
39}
40
41#[cfg(feature = "api-crypto-ec")]
42impl crate::crypto::ec::Curve {
43 pub const fn int_len(self) -> usize {
45 match self {
46 crate::crypto::ec::Curve::P256 => 32,
47 crate::crypto::ec::Curve::P384 => 48,
48 }
49 }
50}
51
52impl core::ops::Sub for crate::debug::Perf {
53 type Output = crate::debug::Perf;
54
55 fn sub(self, rhs: Self) -> Self::Output {
56 Self {
57 platform: self.platform - rhs.platform,
58 applets: self.applets - rhs.applets,
59 waiting: self.waiting - rhs.waiting,
60 }
61 }
62}
63
64impl core::ops::SubAssign for crate::debug::Perf {
65 fn sub_assign(&mut self, rhs: Self) {
66 self.platform -= rhs.platform;
67 self.applets -= rhs.applets;
68 self.waiting -= rhs.waiting;
69 }
70}