fidl_fuchsia_kms__common/
fidl_fuchsia_kms__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const MAX_DATA_SIZE: u32 = 65536;
12
13pub const MAX_HARDWARE_DERIVED_KEY_SIZE: u8 = 32;
14
15pub const MAX_HARDWARE_DERIVE_KEY_INFO_SIZE: u8 = 32;
16
17pub const MAX_KEY_NAME_SIZE: u8 = 32;
18
19#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
20#[repr(u32)]
21pub enum AsymmetricKeyAlgorithm {
22    RsaSsaPssSha2562048 = 1,
23    RsaSsaPssSha2563072 = 2,
24    RsaSsaPssSha5124096 = 3,
25    RsaSsaPkcs1Sha2562048 = 4,
26    RsaSsaPkcs1Sha2563072 = 5,
27    RsaSsaPkcs1Sha5124096 = 6,
28    EcdsaSha256P256 = 7,
29    EcdsaSha512P384 = 8,
30    EcdsaSha512P521 = 9,
31}
32
33impl AsymmetricKeyAlgorithm {
34    #[inline]
35    pub fn from_primitive(prim: u32) -> Option<Self> {
36        match prim {
37            1 => Some(Self::RsaSsaPssSha2562048),
38            2 => Some(Self::RsaSsaPssSha2563072),
39            3 => Some(Self::RsaSsaPssSha5124096),
40            4 => Some(Self::RsaSsaPkcs1Sha2562048),
41            5 => Some(Self::RsaSsaPkcs1Sha2563072),
42            6 => Some(Self::RsaSsaPkcs1Sha5124096),
43            7 => Some(Self::EcdsaSha256P256),
44            8 => Some(Self::EcdsaSha512P384),
45            9 => Some(Self::EcdsaSha512P521),
46            _ => None,
47        }
48    }
49
50    #[inline]
51    pub const fn into_primitive(self) -> u32 {
52        self as u32
53    }
54}
55
56#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
57#[repr(u32)]
58pub enum Error {
59    /// Internal unexpected error.
60    InternalError = 1,
61    /// When trying to create/import a new key but a key with the same name already exists.
62    KeyAlreadyExists = 2,
63    /// When the key you are trying to use is not found.
64    KeyNotFound = 3,
65    /// When the key material could not be parsed.
66    ParseKeyError = 4,
67    /// When the size for input data is larger than `MAX_DATA_SIZE`.
68    InputTooLarge = 5,
69}
70
71impl Error {
72    #[inline]
73    pub fn from_primitive(prim: u32) -> Option<Self> {
74        match prim {
75            1 => Some(Self::InternalError),
76            2 => Some(Self::KeyAlreadyExists),
77            3 => Some(Self::KeyNotFound),
78            4 => Some(Self::ParseKeyError),
79            5 => Some(Self::InputTooLarge),
80            _ => None,
81        }
82    }
83
84    #[inline]
85    pub const fn into_primitive(self) -> u32 {
86        self as u32
87    }
88}
89
90#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
91#[repr(u32)]
92pub enum KeyOrigin {
93    /// The key was generated in this KMS instance.
94    Generated = 1,
95    /// The key was imported.
96    Imported = 2,
97}
98
99impl KeyOrigin {
100    #[inline]
101    pub fn from_primitive(prim: u32) -> Option<Self> {
102        match prim {
103            1 => Some(Self::Generated),
104            2 => Some(Self::Imported),
105            _ => None,
106        }
107    }
108
109    #[inline]
110    pub const fn into_primitive(self) -> u32 {
111        self as u32
112    }
113}
114
115#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
116#[repr(u32)]
117pub enum KeyProvider {
118    /// A mock provider only used for unit testing.
119    MockProvider = 1,
120    /// A software provider that uses rust AesGcm trait for symmetric key operation and mundane for
121    /// asymmetric key operation.
122    SoftwareProvider = 2,
123    /// A software provider that only supports mundane-based asymmetric key operation.
124    SoftwareAsymmetricOnlyProvider = 3,
125    /// A crypto provider based on Keysafe Trusted App in OPTEE.
126    OpteeProvider = 4,
127}
128
129impl KeyProvider {
130    #[inline]
131    pub fn from_primitive(prim: u32) -> Option<Self> {
132        match prim {
133            1 => Some(Self::MockProvider),
134            2 => Some(Self::SoftwareProvider),
135            3 => Some(Self::SoftwareAsymmetricOnlyProvider),
136            4 => Some(Self::OpteeProvider),
137            _ => None,
138        }
139    }
140
141    #[inline]
142    pub const fn into_primitive(self) -> u32 {
143        self as u32
144    }
145}
146
147#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
148pub struct AsymmetricPrivateKeyGetKeyAlgorithmResponse {
149    pub key_algorithm: AsymmetricKeyAlgorithm,
150}
151
152impl fidl::Persistable for AsymmetricPrivateKeyGetKeyAlgorithmResponse {}
153
154#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
155pub struct AsymmetricPrivateKeyGetPublicKeyResponse {
156    pub public_key: PublicKey,
157}
158
159impl fidl::Persistable for AsymmetricPrivateKeyGetPublicKeyResponse {}
160
161#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
162pub struct AsymmetricPrivateKeySignResponse {
163    pub signature: Signature,
164}
165
166impl fidl::Persistable for AsymmetricPrivateKeySignResponse {}
167
168#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
169pub struct KeyManagerDeleteKeyRequest {
170    pub key_name: String,
171}
172
173impl fidl::Persistable for KeyManagerDeleteKeyRequest {}
174
175#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
176pub struct KeyGetKeyOriginResponse {
177    pub key_origin: KeyOrigin,
178}
179
180impl fidl::Persistable for KeyGetKeyOriginResponse {}
181
182#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
183pub struct KeyGetKeyProviderResponse {
184    pub key_provider: KeyProvider,
185}
186
187impl fidl::Persistable for KeyGetKeyProviderResponse {}
188
189#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
190pub struct PublicKey {
191    pub bytes: Vec<u8>,
192}
193
194impl fidl::Persistable for PublicKey {}
195
196#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
197pub struct Signature {
198    pub bytes: Vec<u8>,
199}
200
201impl fidl::Persistable for Signature {}
202
203#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
204pub struct StatelessKeyManagerGetHardwareDerivedKeyRequest {
205    pub key_info: Vec<u8>,
206}
207
208impl fidl::Persistable for StatelessKeyManagerGetHardwareDerivedKeyRequest {}
209
210#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
211pub struct StatelessKeyManagerGetHardwareDerivedKeyResponse {
212    pub derived_key: Vec<u8>,
213}
214
215impl fidl::Persistable for StatelessKeyManagerGetHardwareDerivedKeyResponse {}
216
217mod internal {
218    use super::*;
219    unsafe impl fidl::encoding::TypeMarker for AsymmetricKeyAlgorithm {
220        type Owned = Self;
221
222        #[inline(always)]
223        fn inline_align(_context: fidl::encoding::Context) -> usize {
224            std::mem::align_of::<u32>()
225        }
226
227        #[inline(always)]
228        fn inline_size(_context: fidl::encoding::Context) -> usize {
229            std::mem::size_of::<u32>()
230        }
231
232        #[inline(always)]
233        fn encode_is_copy() -> bool {
234            true
235        }
236
237        #[inline(always)]
238        fn decode_is_copy() -> bool {
239            false
240        }
241    }
242
243    impl fidl::encoding::ValueTypeMarker for AsymmetricKeyAlgorithm {
244        type Borrowed<'a> = Self;
245        #[inline(always)]
246        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
247            *value
248        }
249    }
250
251    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
252        for AsymmetricKeyAlgorithm
253    {
254        #[inline]
255        unsafe fn encode(
256            self,
257            encoder: &mut fidl::encoding::Encoder<'_, D>,
258            offset: usize,
259            _depth: fidl::encoding::Depth,
260        ) -> fidl::Result<()> {
261            encoder.debug_check_bounds::<Self>(offset);
262            encoder.write_num(self.into_primitive(), offset);
263            Ok(())
264        }
265    }
266
267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
268        for AsymmetricKeyAlgorithm
269    {
270        #[inline(always)]
271        fn new_empty() -> Self {
272            Self::RsaSsaPssSha2562048
273        }
274
275        #[inline]
276        unsafe fn decode(
277            &mut self,
278            decoder: &mut fidl::encoding::Decoder<'_, D>,
279            offset: usize,
280            _depth: fidl::encoding::Depth,
281        ) -> fidl::Result<()> {
282            decoder.debug_check_bounds::<Self>(offset);
283            let prim = decoder.read_num::<u32>(offset);
284
285            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
286            Ok(())
287        }
288    }
289    unsafe impl fidl::encoding::TypeMarker for Error {
290        type Owned = Self;
291
292        #[inline(always)]
293        fn inline_align(_context: fidl::encoding::Context) -> usize {
294            std::mem::align_of::<u32>()
295        }
296
297        #[inline(always)]
298        fn inline_size(_context: fidl::encoding::Context) -> usize {
299            std::mem::size_of::<u32>()
300        }
301
302        #[inline(always)]
303        fn encode_is_copy() -> bool {
304            true
305        }
306
307        #[inline(always)]
308        fn decode_is_copy() -> bool {
309            false
310        }
311    }
312
313    impl fidl::encoding::ValueTypeMarker for Error {
314        type Borrowed<'a> = Self;
315        #[inline(always)]
316        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
317            *value
318        }
319    }
320
321    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
322        #[inline]
323        unsafe fn encode(
324            self,
325            encoder: &mut fidl::encoding::Encoder<'_, D>,
326            offset: usize,
327            _depth: fidl::encoding::Depth,
328        ) -> fidl::Result<()> {
329            encoder.debug_check_bounds::<Self>(offset);
330            encoder.write_num(self.into_primitive(), offset);
331            Ok(())
332        }
333    }
334
335    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
336        #[inline(always)]
337        fn new_empty() -> Self {
338            Self::InternalError
339        }
340
341        #[inline]
342        unsafe fn decode(
343            &mut self,
344            decoder: &mut fidl::encoding::Decoder<'_, D>,
345            offset: usize,
346            _depth: fidl::encoding::Depth,
347        ) -> fidl::Result<()> {
348            decoder.debug_check_bounds::<Self>(offset);
349            let prim = decoder.read_num::<u32>(offset);
350
351            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
352            Ok(())
353        }
354    }
355    unsafe impl fidl::encoding::TypeMarker for KeyOrigin {
356        type Owned = Self;
357
358        #[inline(always)]
359        fn inline_align(_context: fidl::encoding::Context) -> usize {
360            std::mem::align_of::<u32>()
361        }
362
363        #[inline(always)]
364        fn inline_size(_context: fidl::encoding::Context) -> usize {
365            std::mem::size_of::<u32>()
366        }
367
368        #[inline(always)]
369        fn encode_is_copy() -> bool {
370            true
371        }
372
373        #[inline(always)]
374        fn decode_is_copy() -> bool {
375            false
376        }
377    }
378
379    impl fidl::encoding::ValueTypeMarker for KeyOrigin {
380        type Borrowed<'a> = Self;
381        #[inline(always)]
382        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
383            *value
384        }
385    }
386
387    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for KeyOrigin {
388        #[inline]
389        unsafe fn encode(
390            self,
391            encoder: &mut fidl::encoding::Encoder<'_, D>,
392            offset: usize,
393            _depth: fidl::encoding::Depth,
394        ) -> fidl::Result<()> {
395            encoder.debug_check_bounds::<Self>(offset);
396            encoder.write_num(self.into_primitive(), offset);
397            Ok(())
398        }
399    }
400
401    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyOrigin {
402        #[inline(always)]
403        fn new_empty() -> Self {
404            Self::Generated
405        }
406
407        #[inline]
408        unsafe fn decode(
409            &mut self,
410            decoder: &mut fidl::encoding::Decoder<'_, D>,
411            offset: usize,
412            _depth: fidl::encoding::Depth,
413        ) -> fidl::Result<()> {
414            decoder.debug_check_bounds::<Self>(offset);
415            let prim = decoder.read_num::<u32>(offset);
416
417            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
418            Ok(())
419        }
420    }
421    unsafe impl fidl::encoding::TypeMarker for KeyProvider {
422        type Owned = Self;
423
424        #[inline(always)]
425        fn inline_align(_context: fidl::encoding::Context) -> usize {
426            std::mem::align_of::<u32>()
427        }
428
429        #[inline(always)]
430        fn inline_size(_context: fidl::encoding::Context) -> usize {
431            std::mem::size_of::<u32>()
432        }
433
434        #[inline(always)]
435        fn encode_is_copy() -> bool {
436            true
437        }
438
439        #[inline(always)]
440        fn decode_is_copy() -> bool {
441            false
442        }
443    }
444
445    impl fidl::encoding::ValueTypeMarker for KeyProvider {
446        type Borrowed<'a> = Self;
447        #[inline(always)]
448        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
449            *value
450        }
451    }
452
453    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for KeyProvider {
454        #[inline]
455        unsafe fn encode(
456            self,
457            encoder: &mut fidl::encoding::Encoder<'_, D>,
458            offset: usize,
459            _depth: fidl::encoding::Depth,
460        ) -> fidl::Result<()> {
461            encoder.debug_check_bounds::<Self>(offset);
462            encoder.write_num(self.into_primitive(), offset);
463            Ok(())
464        }
465    }
466
467    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyProvider {
468        #[inline(always)]
469        fn new_empty() -> Self {
470            Self::MockProvider
471        }
472
473        #[inline]
474        unsafe fn decode(
475            &mut self,
476            decoder: &mut fidl::encoding::Decoder<'_, D>,
477            offset: usize,
478            _depth: fidl::encoding::Depth,
479        ) -> fidl::Result<()> {
480            decoder.debug_check_bounds::<Self>(offset);
481            let prim = decoder.read_num::<u32>(offset);
482
483            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
484            Ok(())
485        }
486    }
487
488    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeyGetKeyAlgorithmResponse {
489        type Borrowed<'a> = &'a Self;
490        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
491            value
492        }
493    }
494
495    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeyGetKeyAlgorithmResponse {
496        type Owned = Self;
497
498        #[inline(always)]
499        fn inline_align(_context: fidl::encoding::Context) -> usize {
500            4
501        }
502
503        #[inline(always)]
504        fn inline_size(_context: fidl::encoding::Context) -> usize {
505            4
506        }
507    }
508
509    unsafe impl<D: fidl::encoding::ResourceDialect>
510        fidl::encoding::Encode<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D>
511        for &AsymmetricPrivateKeyGetKeyAlgorithmResponse
512    {
513        #[inline]
514        unsafe fn encode(
515            self,
516            encoder: &mut fidl::encoding::Encoder<'_, D>,
517            offset: usize,
518            _depth: fidl::encoding::Depth,
519        ) -> fidl::Result<()> {
520            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetKeyAlgorithmResponse>(offset);
521            // Delegate to tuple encoding.
522            fidl::encoding::Encode::<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D>::encode(
523                (<AsymmetricKeyAlgorithm as fidl::encoding::ValueTypeMarker>::borrow(
524                    &self.key_algorithm,
525                ),),
526                encoder,
527                offset,
528                _depth,
529            )
530        }
531    }
532    unsafe impl<
533            D: fidl::encoding::ResourceDialect,
534            T0: fidl::encoding::Encode<AsymmetricKeyAlgorithm, D>,
535        > fidl::encoding::Encode<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D> for (T0,)
536    {
537        #[inline]
538        unsafe fn encode(
539            self,
540            encoder: &mut fidl::encoding::Encoder<'_, D>,
541            offset: usize,
542            depth: fidl::encoding::Depth,
543        ) -> fidl::Result<()> {
544            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetKeyAlgorithmResponse>(offset);
545            // Zero out padding regions. There's no need to apply masks
546            // because the unmasked parts will be overwritten by fields.
547            // Write the fields.
548            self.0.encode(encoder, offset + 0, depth)?;
549            Ok(())
550        }
551    }
552
553    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
554        for AsymmetricPrivateKeyGetKeyAlgorithmResponse
555    {
556        #[inline(always)]
557        fn new_empty() -> Self {
558            Self { key_algorithm: fidl::new_empty!(AsymmetricKeyAlgorithm, D) }
559        }
560
561        #[inline]
562        unsafe fn decode(
563            &mut self,
564            decoder: &mut fidl::encoding::Decoder<'_, D>,
565            offset: usize,
566            _depth: fidl::encoding::Depth,
567        ) -> fidl::Result<()> {
568            decoder.debug_check_bounds::<Self>(offset);
569            // Verify that padding bytes are zero.
570            fidl::decode!(
571                AsymmetricKeyAlgorithm,
572                D,
573                &mut self.key_algorithm,
574                decoder,
575                offset + 0,
576                _depth
577            )?;
578            Ok(())
579        }
580    }
581
582    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeyGetPublicKeyResponse {
583        type Borrowed<'a> = &'a Self;
584        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
585            value
586        }
587    }
588
589    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeyGetPublicKeyResponse {
590        type Owned = Self;
591
592        #[inline(always)]
593        fn inline_align(_context: fidl::encoding::Context) -> usize {
594            8
595        }
596
597        #[inline(always)]
598        fn inline_size(_context: fidl::encoding::Context) -> usize {
599            16
600        }
601    }
602
603    unsafe impl<D: fidl::encoding::ResourceDialect>
604        fidl::encoding::Encode<AsymmetricPrivateKeyGetPublicKeyResponse, D>
605        for &AsymmetricPrivateKeyGetPublicKeyResponse
606    {
607        #[inline]
608        unsafe fn encode(
609            self,
610            encoder: &mut fidl::encoding::Encoder<'_, D>,
611            offset: usize,
612            _depth: fidl::encoding::Depth,
613        ) -> fidl::Result<()> {
614            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetPublicKeyResponse>(offset);
615            // Delegate to tuple encoding.
616            fidl::encoding::Encode::<AsymmetricPrivateKeyGetPublicKeyResponse, D>::encode(
617                (<PublicKey as fidl::encoding::ValueTypeMarker>::borrow(&self.public_key),),
618                encoder,
619                offset,
620                _depth,
621            )
622        }
623    }
624    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PublicKey, D>>
625        fidl::encoding::Encode<AsymmetricPrivateKeyGetPublicKeyResponse, D> for (T0,)
626    {
627        #[inline]
628        unsafe fn encode(
629            self,
630            encoder: &mut fidl::encoding::Encoder<'_, D>,
631            offset: usize,
632            depth: fidl::encoding::Depth,
633        ) -> fidl::Result<()> {
634            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetPublicKeyResponse>(offset);
635            // Zero out padding regions. There's no need to apply masks
636            // because the unmasked parts will be overwritten by fields.
637            // Write the fields.
638            self.0.encode(encoder, offset + 0, depth)?;
639            Ok(())
640        }
641    }
642
643    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
644        for AsymmetricPrivateKeyGetPublicKeyResponse
645    {
646        #[inline(always)]
647        fn new_empty() -> Self {
648            Self { public_key: fidl::new_empty!(PublicKey, D) }
649        }
650
651        #[inline]
652        unsafe fn decode(
653            &mut self,
654            decoder: &mut fidl::encoding::Decoder<'_, D>,
655            offset: usize,
656            _depth: fidl::encoding::Depth,
657        ) -> fidl::Result<()> {
658            decoder.debug_check_bounds::<Self>(offset);
659            // Verify that padding bytes are zero.
660            fidl::decode!(PublicKey, D, &mut self.public_key, decoder, offset + 0, _depth)?;
661            Ok(())
662        }
663    }
664
665    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeySignResponse {
666        type Borrowed<'a> = &'a Self;
667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
668            value
669        }
670    }
671
672    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeySignResponse {
673        type Owned = Self;
674
675        #[inline(always)]
676        fn inline_align(_context: fidl::encoding::Context) -> usize {
677            8
678        }
679
680        #[inline(always)]
681        fn inline_size(_context: fidl::encoding::Context) -> usize {
682            16
683        }
684    }
685
686    unsafe impl<D: fidl::encoding::ResourceDialect>
687        fidl::encoding::Encode<AsymmetricPrivateKeySignResponse, D>
688        for &AsymmetricPrivateKeySignResponse
689    {
690        #[inline]
691        unsafe fn encode(
692            self,
693            encoder: &mut fidl::encoding::Encoder<'_, D>,
694            offset: usize,
695            _depth: fidl::encoding::Depth,
696        ) -> fidl::Result<()> {
697            encoder.debug_check_bounds::<AsymmetricPrivateKeySignResponse>(offset);
698            // Delegate to tuple encoding.
699            fidl::encoding::Encode::<AsymmetricPrivateKeySignResponse, D>::encode(
700                (<Signature as fidl::encoding::ValueTypeMarker>::borrow(&self.signature),),
701                encoder,
702                offset,
703                _depth,
704            )
705        }
706    }
707    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Signature, D>>
708        fidl::encoding::Encode<AsymmetricPrivateKeySignResponse, D> for (T0,)
709    {
710        #[inline]
711        unsafe fn encode(
712            self,
713            encoder: &mut fidl::encoding::Encoder<'_, D>,
714            offset: usize,
715            depth: fidl::encoding::Depth,
716        ) -> fidl::Result<()> {
717            encoder.debug_check_bounds::<AsymmetricPrivateKeySignResponse>(offset);
718            // Zero out padding regions. There's no need to apply masks
719            // because the unmasked parts will be overwritten by fields.
720            // Write the fields.
721            self.0.encode(encoder, offset + 0, depth)?;
722            Ok(())
723        }
724    }
725
726    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
727        for AsymmetricPrivateKeySignResponse
728    {
729        #[inline(always)]
730        fn new_empty() -> Self {
731            Self { signature: fidl::new_empty!(Signature, D) }
732        }
733
734        #[inline]
735        unsafe fn decode(
736            &mut self,
737            decoder: &mut fidl::encoding::Decoder<'_, D>,
738            offset: usize,
739            _depth: fidl::encoding::Depth,
740        ) -> fidl::Result<()> {
741            decoder.debug_check_bounds::<Self>(offset);
742            // Verify that padding bytes are zero.
743            fidl::decode!(Signature, D, &mut self.signature, decoder, offset + 0, _depth)?;
744            Ok(())
745        }
746    }
747
748    impl fidl::encoding::ValueTypeMarker for KeyManagerDeleteKeyRequest {
749        type Borrowed<'a> = &'a Self;
750        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
751            value
752        }
753    }
754
755    unsafe impl fidl::encoding::TypeMarker for KeyManagerDeleteKeyRequest {
756        type Owned = Self;
757
758        #[inline(always)]
759        fn inline_align(_context: fidl::encoding::Context) -> usize {
760            8
761        }
762
763        #[inline(always)]
764        fn inline_size(_context: fidl::encoding::Context) -> usize {
765            16
766        }
767    }
768
769    unsafe impl<D: fidl::encoding::ResourceDialect>
770        fidl::encoding::Encode<KeyManagerDeleteKeyRequest, D> for &KeyManagerDeleteKeyRequest
771    {
772        #[inline]
773        unsafe fn encode(
774            self,
775            encoder: &mut fidl::encoding::Encoder<'_, D>,
776            offset: usize,
777            _depth: fidl::encoding::Depth,
778        ) -> fidl::Result<()> {
779            encoder.debug_check_bounds::<KeyManagerDeleteKeyRequest>(offset);
780            // Delegate to tuple encoding.
781            fidl::encoding::Encode::<KeyManagerDeleteKeyRequest, D>::encode(
782                (<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
783                    &self.key_name,
784                ),),
785                encoder,
786                offset,
787                _depth,
788            )
789        }
790    }
791    unsafe impl<
792            D: fidl::encoding::ResourceDialect,
793            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
794        > fidl::encoding::Encode<KeyManagerDeleteKeyRequest, D> for (T0,)
795    {
796        #[inline]
797        unsafe fn encode(
798            self,
799            encoder: &mut fidl::encoding::Encoder<'_, D>,
800            offset: usize,
801            depth: fidl::encoding::Depth,
802        ) -> fidl::Result<()> {
803            encoder.debug_check_bounds::<KeyManagerDeleteKeyRequest>(offset);
804            // Zero out padding regions. There's no need to apply masks
805            // because the unmasked parts will be overwritten by fields.
806            // Write the fields.
807            self.0.encode(encoder, offset + 0, depth)?;
808            Ok(())
809        }
810    }
811
812    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
813        for KeyManagerDeleteKeyRequest
814    {
815        #[inline(always)]
816        fn new_empty() -> Self {
817            Self { key_name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D) }
818        }
819
820        #[inline]
821        unsafe fn decode(
822            &mut self,
823            decoder: &mut fidl::encoding::Decoder<'_, D>,
824            offset: usize,
825            _depth: fidl::encoding::Depth,
826        ) -> fidl::Result<()> {
827            decoder.debug_check_bounds::<Self>(offset);
828            // Verify that padding bytes are zero.
829            fidl::decode!(
830                fidl::encoding::BoundedString<32>,
831                D,
832                &mut self.key_name,
833                decoder,
834                offset + 0,
835                _depth
836            )?;
837            Ok(())
838        }
839    }
840
841    impl fidl::encoding::ValueTypeMarker for KeyGetKeyOriginResponse {
842        type Borrowed<'a> = &'a Self;
843        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
844            value
845        }
846    }
847
848    unsafe impl fidl::encoding::TypeMarker for KeyGetKeyOriginResponse {
849        type Owned = Self;
850
851        #[inline(always)]
852        fn inline_align(_context: fidl::encoding::Context) -> usize {
853            4
854        }
855
856        #[inline(always)]
857        fn inline_size(_context: fidl::encoding::Context) -> usize {
858            4
859        }
860    }
861
862    unsafe impl<D: fidl::encoding::ResourceDialect>
863        fidl::encoding::Encode<KeyGetKeyOriginResponse, D> for &KeyGetKeyOriginResponse
864    {
865        #[inline]
866        unsafe fn encode(
867            self,
868            encoder: &mut fidl::encoding::Encoder<'_, D>,
869            offset: usize,
870            _depth: fidl::encoding::Depth,
871        ) -> fidl::Result<()> {
872            encoder.debug_check_bounds::<KeyGetKeyOriginResponse>(offset);
873            // Delegate to tuple encoding.
874            fidl::encoding::Encode::<KeyGetKeyOriginResponse, D>::encode(
875                (<KeyOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.key_origin),),
876                encoder,
877                offset,
878                _depth,
879            )
880        }
881    }
882    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyOrigin, D>>
883        fidl::encoding::Encode<KeyGetKeyOriginResponse, D> for (T0,)
884    {
885        #[inline]
886        unsafe fn encode(
887            self,
888            encoder: &mut fidl::encoding::Encoder<'_, D>,
889            offset: usize,
890            depth: fidl::encoding::Depth,
891        ) -> fidl::Result<()> {
892            encoder.debug_check_bounds::<KeyGetKeyOriginResponse>(offset);
893            // Zero out padding regions. There's no need to apply masks
894            // because the unmasked parts will be overwritten by fields.
895            // Write the fields.
896            self.0.encode(encoder, offset + 0, depth)?;
897            Ok(())
898        }
899    }
900
901    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
902        for KeyGetKeyOriginResponse
903    {
904        #[inline(always)]
905        fn new_empty() -> Self {
906            Self { key_origin: fidl::new_empty!(KeyOrigin, D) }
907        }
908
909        #[inline]
910        unsafe fn decode(
911            &mut self,
912            decoder: &mut fidl::encoding::Decoder<'_, D>,
913            offset: usize,
914            _depth: fidl::encoding::Depth,
915        ) -> fidl::Result<()> {
916            decoder.debug_check_bounds::<Self>(offset);
917            // Verify that padding bytes are zero.
918            fidl::decode!(KeyOrigin, D, &mut self.key_origin, decoder, offset + 0, _depth)?;
919            Ok(())
920        }
921    }
922
923    impl fidl::encoding::ValueTypeMarker for KeyGetKeyProviderResponse {
924        type Borrowed<'a> = &'a Self;
925        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
926            value
927        }
928    }
929
930    unsafe impl fidl::encoding::TypeMarker for KeyGetKeyProviderResponse {
931        type Owned = Self;
932
933        #[inline(always)]
934        fn inline_align(_context: fidl::encoding::Context) -> usize {
935            4
936        }
937
938        #[inline(always)]
939        fn inline_size(_context: fidl::encoding::Context) -> usize {
940            4
941        }
942    }
943
944    unsafe impl<D: fidl::encoding::ResourceDialect>
945        fidl::encoding::Encode<KeyGetKeyProviderResponse, D> for &KeyGetKeyProviderResponse
946    {
947        #[inline]
948        unsafe fn encode(
949            self,
950            encoder: &mut fidl::encoding::Encoder<'_, D>,
951            offset: usize,
952            _depth: fidl::encoding::Depth,
953        ) -> fidl::Result<()> {
954            encoder.debug_check_bounds::<KeyGetKeyProviderResponse>(offset);
955            // Delegate to tuple encoding.
956            fidl::encoding::Encode::<KeyGetKeyProviderResponse, D>::encode(
957                (<KeyProvider as fidl::encoding::ValueTypeMarker>::borrow(&self.key_provider),),
958                encoder,
959                offset,
960                _depth,
961            )
962        }
963    }
964    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyProvider, D>>
965        fidl::encoding::Encode<KeyGetKeyProviderResponse, D> for (T0,)
966    {
967        #[inline]
968        unsafe fn encode(
969            self,
970            encoder: &mut fidl::encoding::Encoder<'_, D>,
971            offset: usize,
972            depth: fidl::encoding::Depth,
973        ) -> fidl::Result<()> {
974            encoder.debug_check_bounds::<KeyGetKeyProviderResponse>(offset);
975            // Zero out padding regions. There's no need to apply masks
976            // because the unmasked parts will be overwritten by fields.
977            // Write the fields.
978            self.0.encode(encoder, offset + 0, depth)?;
979            Ok(())
980        }
981    }
982
983    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
984        for KeyGetKeyProviderResponse
985    {
986        #[inline(always)]
987        fn new_empty() -> Self {
988            Self { key_provider: fidl::new_empty!(KeyProvider, D) }
989        }
990
991        #[inline]
992        unsafe fn decode(
993            &mut self,
994            decoder: &mut fidl::encoding::Decoder<'_, D>,
995            offset: usize,
996            _depth: fidl::encoding::Depth,
997        ) -> fidl::Result<()> {
998            decoder.debug_check_bounds::<Self>(offset);
999            // Verify that padding bytes are zero.
1000            fidl::decode!(KeyProvider, D, &mut self.key_provider, decoder, offset + 0, _depth)?;
1001            Ok(())
1002        }
1003    }
1004
1005    impl fidl::encoding::ValueTypeMarker for PublicKey {
1006        type Borrowed<'a> = &'a Self;
1007        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1008            value
1009        }
1010    }
1011
1012    unsafe impl fidl::encoding::TypeMarker for PublicKey {
1013        type Owned = Self;
1014
1015        #[inline(always)]
1016        fn inline_align(_context: fidl::encoding::Context) -> usize {
1017            8
1018        }
1019
1020        #[inline(always)]
1021        fn inline_size(_context: fidl::encoding::Context) -> usize {
1022            16
1023        }
1024    }
1025
1026    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PublicKey, D>
1027        for &PublicKey
1028    {
1029        #[inline]
1030        unsafe fn encode(
1031            self,
1032            encoder: &mut fidl::encoding::Encoder<'_, D>,
1033            offset: usize,
1034            _depth: fidl::encoding::Depth,
1035        ) -> fidl::Result<()> {
1036            encoder.debug_check_bounds::<PublicKey>(offset);
1037            // Delegate to tuple encoding.
1038            fidl::encoding::Encode::<PublicKey, D>::encode(
1039                (<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(
1040                    &self.bytes,
1041                ),),
1042                encoder,
1043                offset,
1044                _depth,
1045            )
1046        }
1047    }
1048    unsafe impl<
1049            D: fidl::encoding::ResourceDialect,
1050            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 256>, D>,
1051        > fidl::encoding::Encode<PublicKey, D> for (T0,)
1052    {
1053        #[inline]
1054        unsafe fn encode(
1055            self,
1056            encoder: &mut fidl::encoding::Encoder<'_, D>,
1057            offset: usize,
1058            depth: fidl::encoding::Depth,
1059        ) -> fidl::Result<()> {
1060            encoder.debug_check_bounds::<PublicKey>(offset);
1061            // Zero out padding regions. There's no need to apply masks
1062            // because the unmasked parts will be overwritten by fields.
1063            // Write the fields.
1064            self.0.encode(encoder, offset + 0, depth)?;
1065            Ok(())
1066        }
1067    }
1068
1069    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PublicKey {
1070        #[inline(always)]
1071        fn new_empty() -> Self {
1072            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D) }
1073        }
1074
1075        #[inline]
1076        unsafe fn decode(
1077            &mut self,
1078            decoder: &mut fidl::encoding::Decoder<'_, D>,
1079            offset: usize,
1080            _depth: fidl::encoding::Depth,
1081        ) -> fidl::Result<()> {
1082            decoder.debug_check_bounds::<Self>(offset);
1083            // Verify that padding bytes are zero.
1084            fidl::decode!(fidl::encoding::Vector<u8, 256>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
1085            Ok(())
1086        }
1087    }
1088
1089    impl fidl::encoding::ValueTypeMarker for Signature {
1090        type Borrowed<'a> = &'a Self;
1091        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1092            value
1093        }
1094    }
1095
1096    unsafe impl fidl::encoding::TypeMarker for Signature {
1097        type Owned = Self;
1098
1099        #[inline(always)]
1100        fn inline_align(_context: fidl::encoding::Context) -> usize {
1101            8
1102        }
1103
1104        #[inline(always)]
1105        fn inline_size(_context: fidl::encoding::Context) -> usize {
1106            16
1107        }
1108    }
1109
1110    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Signature, D>
1111        for &Signature
1112    {
1113        #[inline]
1114        unsafe fn encode(
1115            self,
1116            encoder: &mut fidl::encoding::Encoder<'_, D>,
1117            offset: usize,
1118            _depth: fidl::encoding::Depth,
1119        ) -> fidl::Result<()> {
1120            encoder.debug_check_bounds::<Signature>(offset);
1121            // Delegate to tuple encoding.
1122            fidl::encoding::Encode::<Signature, D>::encode(
1123                (<fidl::encoding::Vector<u8, 512> as fidl::encoding::ValueTypeMarker>::borrow(
1124                    &self.bytes,
1125                ),),
1126                encoder,
1127                offset,
1128                _depth,
1129            )
1130        }
1131    }
1132    unsafe impl<
1133            D: fidl::encoding::ResourceDialect,
1134            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 512>, D>,
1135        > fidl::encoding::Encode<Signature, D> for (T0,)
1136    {
1137        #[inline]
1138        unsafe fn encode(
1139            self,
1140            encoder: &mut fidl::encoding::Encoder<'_, D>,
1141            offset: usize,
1142            depth: fidl::encoding::Depth,
1143        ) -> fidl::Result<()> {
1144            encoder.debug_check_bounds::<Signature>(offset);
1145            // Zero out padding regions. There's no need to apply masks
1146            // because the unmasked parts will be overwritten by fields.
1147            // Write the fields.
1148            self.0.encode(encoder, offset + 0, depth)?;
1149            Ok(())
1150        }
1151    }
1152
1153    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Signature {
1154        #[inline(always)]
1155        fn new_empty() -> Self {
1156            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 512>, D) }
1157        }
1158
1159        #[inline]
1160        unsafe fn decode(
1161            &mut self,
1162            decoder: &mut fidl::encoding::Decoder<'_, D>,
1163            offset: usize,
1164            _depth: fidl::encoding::Depth,
1165        ) -> fidl::Result<()> {
1166            decoder.debug_check_bounds::<Self>(offset);
1167            // Verify that padding bytes are zero.
1168            fidl::decode!(fidl::encoding::Vector<u8, 512>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
1169            Ok(())
1170        }
1171    }
1172
1173    impl fidl::encoding::ValueTypeMarker for StatelessKeyManagerGetHardwareDerivedKeyRequest {
1174        type Borrowed<'a> = &'a Self;
1175        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1176            value
1177        }
1178    }
1179
1180    unsafe impl fidl::encoding::TypeMarker for StatelessKeyManagerGetHardwareDerivedKeyRequest {
1181        type Owned = Self;
1182
1183        #[inline(always)]
1184        fn inline_align(_context: fidl::encoding::Context) -> usize {
1185            8
1186        }
1187
1188        #[inline(always)]
1189        fn inline_size(_context: fidl::encoding::Context) -> usize {
1190            16
1191        }
1192    }
1193
1194    unsafe impl<D: fidl::encoding::ResourceDialect>
1195        fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyRequest, D>
1196        for &StatelessKeyManagerGetHardwareDerivedKeyRequest
1197    {
1198        #[inline]
1199        unsafe fn encode(
1200            self,
1201            encoder: &mut fidl::encoding::Encoder<'_, D>,
1202            offset: usize,
1203            _depth: fidl::encoding::Depth,
1204        ) -> fidl::Result<()> {
1205            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyRequest>(offset);
1206            // Delegate to tuple encoding.
1207            fidl::encoding::Encode::<StatelessKeyManagerGetHardwareDerivedKeyRequest, D>::encode(
1208                (<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
1209                    &self.key_info,
1210                ),),
1211                encoder,
1212                offset,
1213                _depth,
1214            )
1215        }
1216    }
1217    unsafe impl<
1218            D: fidl::encoding::ResourceDialect,
1219            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
1220        > fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyRequest, D> for (T0,)
1221    {
1222        #[inline]
1223        unsafe fn encode(
1224            self,
1225            encoder: &mut fidl::encoding::Encoder<'_, D>,
1226            offset: usize,
1227            depth: fidl::encoding::Depth,
1228        ) -> fidl::Result<()> {
1229            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyRequest>(offset);
1230            // Zero out padding regions. There's no need to apply masks
1231            // because the unmasked parts will be overwritten by fields.
1232            // Write the fields.
1233            self.0.encode(encoder, offset + 0, depth)?;
1234            Ok(())
1235        }
1236    }
1237
1238    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1239        for StatelessKeyManagerGetHardwareDerivedKeyRequest
1240    {
1241        #[inline(always)]
1242        fn new_empty() -> Self {
1243            Self { key_info: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D) }
1244        }
1245
1246        #[inline]
1247        unsafe fn decode(
1248            &mut self,
1249            decoder: &mut fidl::encoding::Decoder<'_, D>,
1250            offset: usize,
1251            _depth: fidl::encoding::Depth,
1252        ) -> fidl::Result<()> {
1253            decoder.debug_check_bounds::<Self>(offset);
1254            // Verify that padding bytes are zero.
1255            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key_info, decoder, offset + 0, _depth)?;
1256            Ok(())
1257        }
1258    }
1259
1260    impl fidl::encoding::ValueTypeMarker for StatelessKeyManagerGetHardwareDerivedKeyResponse {
1261        type Borrowed<'a> = &'a Self;
1262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1263            value
1264        }
1265    }
1266
1267    unsafe impl fidl::encoding::TypeMarker for StatelessKeyManagerGetHardwareDerivedKeyResponse {
1268        type Owned = Self;
1269
1270        #[inline(always)]
1271        fn inline_align(_context: fidl::encoding::Context) -> usize {
1272            8
1273        }
1274
1275        #[inline(always)]
1276        fn inline_size(_context: fidl::encoding::Context) -> usize {
1277            16
1278        }
1279    }
1280
1281    unsafe impl<D: fidl::encoding::ResourceDialect>
1282        fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyResponse, D>
1283        for &StatelessKeyManagerGetHardwareDerivedKeyResponse
1284    {
1285        #[inline]
1286        unsafe fn encode(
1287            self,
1288            encoder: &mut fidl::encoding::Encoder<'_, D>,
1289            offset: usize,
1290            _depth: fidl::encoding::Depth,
1291        ) -> fidl::Result<()> {
1292            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyResponse>(offset);
1293            // Delegate to tuple encoding.
1294            fidl::encoding::Encode::<StatelessKeyManagerGetHardwareDerivedKeyResponse, D>::encode(
1295                (<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
1296                    &self.derived_key,
1297                ),),
1298                encoder,
1299                offset,
1300                _depth,
1301            )
1302        }
1303    }
1304    unsafe impl<
1305            D: fidl::encoding::ResourceDialect,
1306            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
1307        > fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyResponse, D> for (T0,)
1308    {
1309        #[inline]
1310        unsafe fn encode(
1311            self,
1312            encoder: &mut fidl::encoding::Encoder<'_, D>,
1313            offset: usize,
1314            depth: fidl::encoding::Depth,
1315        ) -> fidl::Result<()> {
1316            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyResponse>(offset);
1317            // Zero out padding regions. There's no need to apply masks
1318            // because the unmasked parts will be overwritten by fields.
1319            // Write the fields.
1320            self.0.encode(encoder, offset + 0, depth)?;
1321            Ok(())
1322        }
1323    }
1324
1325    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1326        for StatelessKeyManagerGetHardwareDerivedKeyResponse
1327    {
1328        #[inline(always)]
1329        fn new_empty() -> Self {
1330            Self { derived_key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D) }
1331        }
1332
1333        #[inline]
1334        unsafe fn decode(
1335            &mut self,
1336            decoder: &mut fidl::encoding::Decoder<'_, D>,
1337            offset: usize,
1338            _depth: fidl::encoding::Depth,
1339        ) -> fidl::Result<()> {
1340            decoder.debug_check_bounds::<Self>(offset);
1341            // Verify that padding bytes are zero.
1342            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.derived_key, decoder, offset + 0, _depth)?;
1343            Ok(())
1344        }
1345    }
1346}