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
217pub mod asymmetric_private_key_ordinals {
218    pub const GET_KEY_ORIGIN: u64 = 0x3e439554159e7b86;
219    pub const GET_KEY_PROVIDER: u64 = 0x68e2cd7ec0532e0c;
220    pub const SIGN: u64 = 0x524ba8b350c2542e;
221    pub const GET_PUBLIC_KEY: u64 = 0x5439aff00ed261f3;
222    pub const GET_KEY_ALGORITHM: u64 = 0xe0ce6b5b815b1ae;
223}
224
225pub mod key_ordinals {
226    pub const GET_KEY_ORIGIN: u64 = 0x3e439554159e7b86;
227    pub const GET_KEY_PROVIDER: u64 = 0x68e2cd7ec0532e0c;
228}
229
230pub mod key_manager_ordinals {
231    pub const SEAL_DATA: u64 = 0x3d2fcd85d11c96bb;
232    pub const UNSEAL_DATA: u64 = 0x72dafc3131c1bca6;
233    pub const GENERATE_ASYMMETRIC_KEY: u64 = 0x66f1aa7ff5eb183d;
234    pub const GENERATE_ASYMMETRIC_KEY_WITH_ALGORITHM: u64 = 0x2b9eac3ad0bc8a45;
235    pub const IMPORT_ASYMMETRIC_PRIVATE_KEY: u64 = 0x14c78f1ebb4eee71;
236    pub const GET_ASYMMETRIC_PRIVATE_KEY: u64 = 0x3a257fc6b6ccc5cd;
237    pub const DELETE_KEY: u64 = 0x55521e617d023aad;
238}
239
240pub mod stateless_key_manager_ordinals {
241    pub const GET_HARDWARE_DERIVED_KEY: u64 = 0x685043d9e68d5f86;
242}
243
244mod internal {
245    use super::*;
246    unsafe impl fidl::encoding::TypeMarker for AsymmetricKeyAlgorithm {
247        type Owned = Self;
248
249        #[inline(always)]
250        fn inline_align(_context: fidl::encoding::Context) -> usize {
251            std::mem::align_of::<u32>()
252        }
253
254        #[inline(always)]
255        fn inline_size(_context: fidl::encoding::Context) -> usize {
256            std::mem::size_of::<u32>()
257        }
258
259        #[inline(always)]
260        fn encode_is_copy() -> bool {
261            true
262        }
263
264        #[inline(always)]
265        fn decode_is_copy() -> bool {
266            false
267        }
268    }
269
270    impl fidl::encoding::ValueTypeMarker for AsymmetricKeyAlgorithm {
271        type Borrowed<'a> = Self;
272        #[inline(always)]
273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
274            *value
275        }
276    }
277
278    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
279        for AsymmetricKeyAlgorithm
280    {
281        #[inline]
282        unsafe fn encode(
283            self,
284            encoder: &mut fidl::encoding::Encoder<'_, D>,
285            offset: usize,
286            _depth: fidl::encoding::Depth,
287        ) -> fidl::Result<()> {
288            encoder.debug_check_bounds::<Self>(offset);
289            encoder.write_num(self.into_primitive(), offset);
290            Ok(())
291        }
292    }
293
294    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
295        for AsymmetricKeyAlgorithm
296    {
297        #[inline(always)]
298        fn new_empty() -> Self {
299            Self::RsaSsaPssSha2562048
300        }
301
302        #[inline]
303        unsafe fn decode(
304            &mut self,
305            decoder: &mut fidl::encoding::Decoder<'_, D>,
306            offset: usize,
307            _depth: fidl::encoding::Depth,
308        ) -> fidl::Result<()> {
309            decoder.debug_check_bounds::<Self>(offset);
310            let prim = decoder.read_num::<u32>(offset);
311
312            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
313            Ok(())
314        }
315    }
316    unsafe impl fidl::encoding::TypeMarker for Error {
317        type Owned = Self;
318
319        #[inline(always)]
320        fn inline_align(_context: fidl::encoding::Context) -> usize {
321            std::mem::align_of::<u32>()
322        }
323
324        #[inline(always)]
325        fn inline_size(_context: fidl::encoding::Context) -> usize {
326            std::mem::size_of::<u32>()
327        }
328
329        #[inline(always)]
330        fn encode_is_copy() -> bool {
331            true
332        }
333
334        #[inline(always)]
335        fn decode_is_copy() -> bool {
336            false
337        }
338    }
339
340    impl fidl::encoding::ValueTypeMarker for Error {
341        type Borrowed<'a> = Self;
342        #[inline(always)]
343        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
344            *value
345        }
346    }
347
348    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Error {
349        #[inline]
350        unsafe fn encode(
351            self,
352            encoder: &mut fidl::encoding::Encoder<'_, D>,
353            offset: usize,
354            _depth: fidl::encoding::Depth,
355        ) -> fidl::Result<()> {
356            encoder.debug_check_bounds::<Self>(offset);
357            encoder.write_num(self.into_primitive(), offset);
358            Ok(())
359        }
360    }
361
362    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Error {
363        #[inline(always)]
364        fn new_empty() -> Self {
365            Self::InternalError
366        }
367
368        #[inline]
369        unsafe fn decode(
370            &mut self,
371            decoder: &mut fidl::encoding::Decoder<'_, D>,
372            offset: usize,
373            _depth: fidl::encoding::Depth,
374        ) -> fidl::Result<()> {
375            decoder.debug_check_bounds::<Self>(offset);
376            let prim = decoder.read_num::<u32>(offset);
377
378            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
379            Ok(())
380        }
381    }
382    unsafe impl fidl::encoding::TypeMarker for KeyOrigin {
383        type Owned = Self;
384
385        #[inline(always)]
386        fn inline_align(_context: fidl::encoding::Context) -> usize {
387            std::mem::align_of::<u32>()
388        }
389
390        #[inline(always)]
391        fn inline_size(_context: fidl::encoding::Context) -> usize {
392            std::mem::size_of::<u32>()
393        }
394
395        #[inline(always)]
396        fn encode_is_copy() -> bool {
397            true
398        }
399
400        #[inline(always)]
401        fn decode_is_copy() -> bool {
402            false
403        }
404    }
405
406    impl fidl::encoding::ValueTypeMarker for KeyOrigin {
407        type Borrowed<'a> = Self;
408        #[inline(always)]
409        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
410            *value
411        }
412    }
413
414    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for KeyOrigin {
415        #[inline]
416        unsafe fn encode(
417            self,
418            encoder: &mut fidl::encoding::Encoder<'_, D>,
419            offset: usize,
420            _depth: fidl::encoding::Depth,
421        ) -> fidl::Result<()> {
422            encoder.debug_check_bounds::<Self>(offset);
423            encoder.write_num(self.into_primitive(), offset);
424            Ok(())
425        }
426    }
427
428    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyOrigin {
429        #[inline(always)]
430        fn new_empty() -> Self {
431            Self::Generated
432        }
433
434        #[inline]
435        unsafe fn decode(
436            &mut self,
437            decoder: &mut fidl::encoding::Decoder<'_, D>,
438            offset: usize,
439            _depth: fidl::encoding::Depth,
440        ) -> fidl::Result<()> {
441            decoder.debug_check_bounds::<Self>(offset);
442            let prim = decoder.read_num::<u32>(offset);
443
444            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
445            Ok(())
446        }
447    }
448    unsafe impl fidl::encoding::TypeMarker for KeyProvider {
449        type Owned = Self;
450
451        #[inline(always)]
452        fn inline_align(_context: fidl::encoding::Context) -> usize {
453            std::mem::align_of::<u32>()
454        }
455
456        #[inline(always)]
457        fn inline_size(_context: fidl::encoding::Context) -> usize {
458            std::mem::size_of::<u32>()
459        }
460
461        #[inline(always)]
462        fn encode_is_copy() -> bool {
463            true
464        }
465
466        #[inline(always)]
467        fn decode_is_copy() -> bool {
468            false
469        }
470    }
471
472    impl fidl::encoding::ValueTypeMarker for KeyProvider {
473        type Borrowed<'a> = Self;
474        #[inline(always)]
475        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
476            *value
477        }
478    }
479
480    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for KeyProvider {
481        #[inline]
482        unsafe fn encode(
483            self,
484            encoder: &mut fidl::encoding::Encoder<'_, D>,
485            offset: usize,
486            _depth: fidl::encoding::Depth,
487        ) -> fidl::Result<()> {
488            encoder.debug_check_bounds::<Self>(offset);
489            encoder.write_num(self.into_primitive(), offset);
490            Ok(())
491        }
492    }
493
494    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for KeyProvider {
495        #[inline(always)]
496        fn new_empty() -> Self {
497            Self::MockProvider
498        }
499
500        #[inline]
501        unsafe fn decode(
502            &mut self,
503            decoder: &mut fidl::encoding::Decoder<'_, D>,
504            offset: usize,
505            _depth: fidl::encoding::Depth,
506        ) -> fidl::Result<()> {
507            decoder.debug_check_bounds::<Self>(offset);
508            let prim = decoder.read_num::<u32>(offset);
509
510            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
511            Ok(())
512        }
513    }
514
515    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeyGetKeyAlgorithmResponse {
516        type Borrowed<'a> = &'a Self;
517        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
518            value
519        }
520    }
521
522    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeyGetKeyAlgorithmResponse {
523        type Owned = Self;
524
525        #[inline(always)]
526        fn inline_align(_context: fidl::encoding::Context) -> usize {
527            4
528        }
529
530        #[inline(always)]
531        fn inline_size(_context: fidl::encoding::Context) -> usize {
532            4
533        }
534    }
535
536    unsafe impl<D: fidl::encoding::ResourceDialect>
537        fidl::encoding::Encode<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D>
538        for &AsymmetricPrivateKeyGetKeyAlgorithmResponse
539    {
540        #[inline]
541        unsafe fn encode(
542            self,
543            encoder: &mut fidl::encoding::Encoder<'_, D>,
544            offset: usize,
545            _depth: fidl::encoding::Depth,
546        ) -> fidl::Result<()> {
547            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetKeyAlgorithmResponse>(offset);
548            // Delegate to tuple encoding.
549            fidl::encoding::Encode::<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D>::encode(
550                (<AsymmetricKeyAlgorithm as fidl::encoding::ValueTypeMarker>::borrow(
551                    &self.key_algorithm,
552                ),),
553                encoder,
554                offset,
555                _depth,
556            )
557        }
558    }
559    unsafe impl<
560            D: fidl::encoding::ResourceDialect,
561            T0: fidl::encoding::Encode<AsymmetricKeyAlgorithm, D>,
562        > fidl::encoding::Encode<AsymmetricPrivateKeyGetKeyAlgorithmResponse, D> for (T0,)
563    {
564        #[inline]
565        unsafe fn encode(
566            self,
567            encoder: &mut fidl::encoding::Encoder<'_, D>,
568            offset: usize,
569            depth: fidl::encoding::Depth,
570        ) -> fidl::Result<()> {
571            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetKeyAlgorithmResponse>(offset);
572            // Zero out padding regions. There's no need to apply masks
573            // because the unmasked parts will be overwritten by fields.
574            // Write the fields.
575            self.0.encode(encoder, offset + 0, depth)?;
576            Ok(())
577        }
578    }
579
580    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
581        for AsymmetricPrivateKeyGetKeyAlgorithmResponse
582    {
583        #[inline(always)]
584        fn new_empty() -> Self {
585            Self { key_algorithm: fidl::new_empty!(AsymmetricKeyAlgorithm, D) }
586        }
587
588        #[inline]
589        unsafe fn decode(
590            &mut self,
591            decoder: &mut fidl::encoding::Decoder<'_, D>,
592            offset: usize,
593            _depth: fidl::encoding::Depth,
594        ) -> fidl::Result<()> {
595            decoder.debug_check_bounds::<Self>(offset);
596            // Verify that padding bytes are zero.
597            fidl::decode!(
598                AsymmetricKeyAlgorithm,
599                D,
600                &mut self.key_algorithm,
601                decoder,
602                offset + 0,
603                _depth
604            )?;
605            Ok(())
606        }
607    }
608
609    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeyGetPublicKeyResponse {
610        type Borrowed<'a> = &'a Self;
611        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
612            value
613        }
614    }
615
616    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeyGetPublicKeyResponse {
617        type Owned = Self;
618
619        #[inline(always)]
620        fn inline_align(_context: fidl::encoding::Context) -> usize {
621            8
622        }
623
624        #[inline(always)]
625        fn inline_size(_context: fidl::encoding::Context) -> usize {
626            16
627        }
628    }
629
630    unsafe impl<D: fidl::encoding::ResourceDialect>
631        fidl::encoding::Encode<AsymmetricPrivateKeyGetPublicKeyResponse, D>
632        for &AsymmetricPrivateKeyGetPublicKeyResponse
633    {
634        #[inline]
635        unsafe fn encode(
636            self,
637            encoder: &mut fidl::encoding::Encoder<'_, D>,
638            offset: usize,
639            _depth: fidl::encoding::Depth,
640        ) -> fidl::Result<()> {
641            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetPublicKeyResponse>(offset);
642            // Delegate to tuple encoding.
643            fidl::encoding::Encode::<AsymmetricPrivateKeyGetPublicKeyResponse, D>::encode(
644                (<PublicKey as fidl::encoding::ValueTypeMarker>::borrow(&self.public_key),),
645                encoder,
646                offset,
647                _depth,
648            )
649        }
650    }
651    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PublicKey, D>>
652        fidl::encoding::Encode<AsymmetricPrivateKeyGetPublicKeyResponse, D> for (T0,)
653    {
654        #[inline]
655        unsafe fn encode(
656            self,
657            encoder: &mut fidl::encoding::Encoder<'_, D>,
658            offset: usize,
659            depth: fidl::encoding::Depth,
660        ) -> fidl::Result<()> {
661            encoder.debug_check_bounds::<AsymmetricPrivateKeyGetPublicKeyResponse>(offset);
662            // Zero out padding regions. There's no need to apply masks
663            // because the unmasked parts will be overwritten by fields.
664            // Write the fields.
665            self.0.encode(encoder, offset + 0, depth)?;
666            Ok(())
667        }
668    }
669
670    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
671        for AsymmetricPrivateKeyGetPublicKeyResponse
672    {
673        #[inline(always)]
674        fn new_empty() -> Self {
675            Self { public_key: fidl::new_empty!(PublicKey, D) }
676        }
677
678        #[inline]
679        unsafe fn decode(
680            &mut self,
681            decoder: &mut fidl::encoding::Decoder<'_, D>,
682            offset: usize,
683            _depth: fidl::encoding::Depth,
684        ) -> fidl::Result<()> {
685            decoder.debug_check_bounds::<Self>(offset);
686            // Verify that padding bytes are zero.
687            fidl::decode!(PublicKey, D, &mut self.public_key, decoder, offset + 0, _depth)?;
688            Ok(())
689        }
690    }
691
692    impl fidl::encoding::ValueTypeMarker for AsymmetricPrivateKeySignResponse {
693        type Borrowed<'a> = &'a Self;
694        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
695            value
696        }
697    }
698
699    unsafe impl fidl::encoding::TypeMarker for AsymmetricPrivateKeySignResponse {
700        type Owned = Self;
701
702        #[inline(always)]
703        fn inline_align(_context: fidl::encoding::Context) -> usize {
704            8
705        }
706
707        #[inline(always)]
708        fn inline_size(_context: fidl::encoding::Context) -> usize {
709            16
710        }
711    }
712
713    unsafe impl<D: fidl::encoding::ResourceDialect>
714        fidl::encoding::Encode<AsymmetricPrivateKeySignResponse, D>
715        for &AsymmetricPrivateKeySignResponse
716    {
717        #[inline]
718        unsafe fn encode(
719            self,
720            encoder: &mut fidl::encoding::Encoder<'_, D>,
721            offset: usize,
722            _depth: fidl::encoding::Depth,
723        ) -> fidl::Result<()> {
724            encoder.debug_check_bounds::<AsymmetricPrivateKeySignResponse>(offset);
725            // Delegate to tuple encoding.
726            fidl::encoding::Encode::<AsymmetricPrivateKeySignResponse, D>::encode(
727                (<Signature as fidl::encoding::ValueTypeMarker>::borrow(&self.signature),),
728                encoder,
729                offset,
730                _depth,
731            )
732        }
733    }
734    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Signature, D>>
735        fidl::encoding::Encode<AsymmetricPrivateKeySignResponse, D> for (T0,)
736    {
737        #[inline]
738        unsafe fn encode(
739            self,
740            encoder: &mut fidl::encoding::Encoder<'_, D>,
741            offset: usize,
742            depth: fidl::encoding::Depth,
743        ) -> fidl::Result<()> {
744            encoder.debug_check_bounds::<AsymmetricPrivateKeySignResponse>(offset);
745            // Zero out padding regions. There's no need to apply masks
746            // because the unmasked parts will be overwritten by fields.
747            // Write the fields.
748            self.0.encode(encoder, offset + 0, depth)?;
749            Ok(())
750        }
751    }
752
753    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
754        for AsymmetricPrivateKeySignResponse
755    {
756        #[inline(always)]
757        fn new_empty() -> Self {
758            Self { signature: fidl::new_empty!(Signature, D) }
759        }
760
761        #[inline]
762        unsafe fn decode(
763            &mut self,
764            decoder: &mut fidl::encoding::Decoder<'_, D>,
765            offset: usize,
766            _depth: fidl::encoding::Depth,
767        ) -> fidl::Result<()> {
768            decoder.debug_check_bounds::<Self>(offset);
769            // Verify that padding bytes are zero.
770            fidl::decode!(Signature, D, &mut self.signature, decoder, offset + 0, _depth)?;
771            Ok(())
772        }
773    }
774
775    impl fidl::encoding::ValueTypeMarker for KeyManagerDeleteKeyRequest {
776        type Borrowed<'a> = &'a Self;
777        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
778            value
779        }
780    }
781
782    unsafe impl fidl::encoding::TypeMarker for KeyManagerDeleteKeyRequest {
783        type Owned = Self;
784
785        #[inline(always)]
786        fn inline_align(_context: fidl::encoding::Context) -> usize {
787            8
788        }
789
790        #[inline(always)]
791        fn inline_size(_context: fidl::encoding::Context) -> usize {
792            16
793        }
794    }
795
796    unsafe impl<D: fidl::encoding::ResourceDialect>
797        fidl::encoding::Encode<KeyManagerDeleteKeyRequest, D> for &KeyManagerDeleteKeyRequest
798    {
799        #[inline]
800        unsafe fn encode(
801            self,
802            encoder: &mut fidl::encoding::Encoder<'_, D>,
803            offset: usize,
804            _depth: fidl::encoding::Depth,
805        ) -> fidl::Result<()> {
806            encoder.debug_check_bounds::<KeyManagerDeleteKeyRequest>(offset);
807            // Delegate to tuple encoding.
808            fidl::encoding::Encode::<KeyManagerDeleteKeyRequest, D>::encode(
809                (<fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(
810                    &self.key_name,
811                ),),
812                encoder,
813                offset,
814                _depth,
815            )
816        }
817    }
818    unsafe impl<
819            D: fidl::encoding::ResourceDialect,
820            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
821        > fidl::encoding::Encode<KeyManagerDeleteKeyRequest, D> for (T0,)
822    {
823        #[inline]
824        unsafe fn encode(
825            self,
826            encoder: &mut fidl::encoding::Encoder<'_, D>,
827            offset: usize,
828            depth: fidl::encoding::Depth,
829        ) -> fidl::Result<()> {
830            encoder.debug_check_bounds::<KeyManagerDeleteKeyRequest>(offset);
831            // Zero out padding regions. There's no need to apply masks
832            // because the unmasked parts will be overwritten by fields.
833            // Write the fields.
834            self.0.encode(encoder, offset + 0, depth)?;
835            Ok(())
836        }
837    }
838
839    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
840        for KeyManagerDeleteKeyRequest
841    {
842        #[inline(always)]
843        fn new_empty() -> Self {
844            Self { key_name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D) }
845        }
846
847        #[inline]
848        unsafe fn decode(
849            &mut self,
850            decoder: &mut fidl::encoding::Decoder<'_, D>,
851            offset: usize,
852            _depth: fidl::encoding::Depth,
853        ) -> fidl::Result<()> {
854            decoder.debug_check_bounds::<Self>(offset);
855            // Verify that padding bytes are zero.
856            fidl::decode!(
857                fidl::encoding::BoundedString<32>,
858                D,
859                &mut self.key_name,
860                decoder,
861                offset + 0,
862                _depth
863            )?;
864            Ok(())
865        }
866    }
867
868    impl fidl::encoding::ValueTypeMarker for KeyGetKeyOriginResponse {
869        type Borrowed<'a> = &'a Self;
870        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
871            value
872        }
873    }
874
875    unsafe impl fidl::encoding::TypeMarker for KeyGetKeyOriginResponse {
876        type Owned = Self;
877
878        #[inline(always)]
879        fn inline_align(_context: fidl::encoding::Context) -> usize {
880            4
881        }
882
883        #[inline(always)]
884        fn inline_size(_context: fidl::encoding::Context) -> usize {
885            4
886        }
887    }
888
889    unsafe impl<D: fidl::encoding::ResourceDialect>
890        fidl::encoding::Encode<KeyGetKeyOriginResponse, D> for &KeyGetKeyOriginResponse
891    {
892        #[inline]
893        unsafe fn encode(
894            self,
895            encoder: &mut fidl::encoding::Encoder<'_, D>,
896            offset: usize,
897            _depth: fidl::encoding::Depth,
898        ) -> fidl::Result<()> {
899            encoder.debug_check_bounds::<KeyGetKeyOriginResponse>(offset);
900            // Delegate to tuple encoding.
901            fidl::encoding::Encode::<KeyGetKeyOriginResponse, D>::encode(
902                (<KeyOrigin as fidl::encoding::ValueTypeMarker>::borrow(&self.key_origin),),
903                encoder,
904                offset,
905                _depth,
906            )
907        }
908    }
909    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyOrigin, D>>
910        fidl::encoding::Encode<KeyGetKeyOriginResponse, D> for (T0,)
911    {
912        #[inline]
913        unsafe fn encode(
914            self,
915            encoder: &mut fidl::encoding::Encoder<'_, D>,
916            offset: usize,
917            depth: fidl::encoding::Depth,
918        ) -> fidl::Result<()> {
919            encoder.debug_check_bounds::<KeyGetKeyOriginResponse>(offset);
920            // Zero out padding regions. There's no need to apply masks
921            // because the unmasked parts will be overwritten by fields.
922            // Write the fields.
923            self.0.encode(encoder, offset + 0, depth)?;
924            Ok(())
925        }
926    }
927
928    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
929        for KeyGetKeyOriginResponse
930    {
931        #[inline(always)]
932        fn new_empty() -> Self {
933            Self { key_origin: fidl::new_empty!(KeyOrigin, D) }
934        }
935
936        #[inline]
937        unsafe fn decode(
938            &mut self,
939            decoder: &mut fidl::encoding::Decoder<'_, D>,
940            offset: usize,
941            _depth: fidl::encoding::Depth,
942        ) -> fidl::Result<()> {
943            decoder.debug_check_bounds::<Self>(offset);
944            // Verify that padding bytes are zero.
945            fidl::decode!(KeyOrigin, D, &mut self.key_origin, decoder, offset + 0, _depth)?;
946            Ok(())
947        }
948    }
949
950    impl fidl::encoding::ValueTypeMarker for KeyGetKeyProviderResponse {
951        type Borrowed<'a> = &'a Self;
952        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
953            value
954        }
955    }
956
957    unsafe impl fidl::encoding::TypeMarker for KeyGetKeyProviderResponse {
958        type Owned = Self;
959
960        #[inline(always)]
961        fn inline_align(_context: fidl::encoding::Context) -> usize {
962            4
963        }
964
965        #[inline(always)]
966        fn inline_size(_context: fidl::encoding::Context) -> usize {
967            4
968        }
969    }
970
971    unsafe impl<D: fidl::encoding::ResourceDialect>
972        fidl::encoding::Encode<KeyGetKeyProviderResponse, D> for &KeyGetKeyProviderResponse
973    {
974        #[inline]
975        unsafe fn encode(
976            self,
977            encoder: &mut fidl::encoding::Encoder<'_, D>,
978            offset: usize,
979            _depth: fidl::encoding::Depth,
980        ) -> fidl::Result<()> {
981            encoder.debug_check_bounds::<KeyGetKeyProviderResponse>(offset);
982            // Delegate to tuple encoding.
983            fidl::encoding::Encode::<KeyGetKeyProviderResponse, D>::encode(
984                (<KeyProvider as fidl::encoding::ValueTypeMarker>::borrow(&self.key_provider),),
985                encoder,
986                offset,
987                _depth,
988            )
989        }
990    }
991    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<KeyProvider, D>>
992        fidl::encoding::Encode<KeyGetKeyProviderResponse, D> for (T0,)
993    {
994        #[inline]
995        unsafe fn encode(
996            self,
997            encoder: &mut fidl::encoding::Encoder<'_, D>,
998            offset: usize,
999            depth: fidl::encoding::Depth,
1000        ) -> fidl::Result<()> {
1001            encoder.debug_check_bounds::<KeyGetKeyProviderResponse>(offset);
1002            // Zero out padding regions. There's no need to apply masks
1003            // because the unmasked parts will be overwritten by fields.
1004            // Write the fields.
1005            self.0.encode(encoder, offset + 0, depth)?;
1006            Ok(())
1007        }
1008    }
1009
1010    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1011        for KeyGetKeyProviderResponse
1012    {
1013        #[inline(always)]
1014        fn new_empty() -> Self {
1015            Self { key_provider: fidl::new_empty!(KeyProvider, D) }
1016        }
1017
1018        #[inline]
1019        unsafe fn decode(
1020            &mut self,
1021            decoder: &mut fidl::encoding::Decoder<'_, D>,
1022            offset: usize,
1023            _depth: fidl::encoding::Depth,
1024        ) -> fidl::Result<()> {
1025            decoder.debug_check_bounds::<Self>(offset);
1026            // Verify that padding bytes are zero.
1027            fidl::decode!(KeyProvider, D, &mut self.key_provider, decoder, offset + 0, _depth)?;
1028            Ok(())
1029        }
1030    }
1031
1032    impl fidl::encoding::ValueTypeMarker for PublicKey {
1033        type Borrowed<'a> = &'a Self;
1034        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1035            value
1036        }
1037    }
1038
1039    unsafe impl fidl::encoding::TypeMarker for PublicKey {
1040        type Owned = Self;
1041
1042        #[inline(always)]
1043        fn inline_align(_context: fidl::encoding::Context) -> usize {
1044            8
1045        }
1046
1047        #[inline(always)]
1048        fn inline_size(_context: fidl::encoding::Context) -> usize {
1049            16
1050        }
1051    }
1052
1053    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PublicKey, D>
1054        for &PublicKey
1055    {
1056        #[inline]
1057        unsafe fn encode(
1058            self,
1059            encoder: &mut fidl::encoding::Encoder<'_, D>,
1060            offset: usize,
1061            _depth: fidl::encoding::Depth,
1062        ) -> fidl::Result<()> {
1063            encoder.debug_check_bounds::<PublicKey>(offset);
1064            // Delegate to tuple encoding.
1065            fidl::encoding::Encode::<PublicKey, D>::encode(
1066                (<fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow(
1067                    &self.bytes,
1068                ),),
1069                encoder,
1070                offset,
1071                _depth,
1072            )
1073        }
1074    }
1075    unsafe impl<
1076            D: fidl::encoding::ResourceDialect,
1077            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 256>, D>,
1078        > fidl::encoding::Encode<PublicKey, D> for (T0,)
1079    {
1080        #[inline]
1081        unsafe fn encode(
1082            self,
1083            encoder: &mut fidl::encoding::Encoder<'_, D>,
1084            offset: usize,
1085            depth: fidl::encoding::Depth,
1086        ) -> fidl::Result<()> {
1087            encoder.debug_check_bounds::<PublicKey>(offset);
1088            // Zero out padding regions. There's no need to apply masks
1089            // because the unmasked parts will be overwritten by fields.
1090            // Write the fields.
1091            self.0.encode(encoder, offset + 0, depth)?;
1092            Ok(())
1093        }
1094    }
1095
1096    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PublicKey {
1097        #[inline(always)]
1098        fn new_empty() -> Self {
1099            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D) }
1100        }
1101
1102        #[inline]
1103        unsafe fn decode(
1104            &mut self,
1105            decoder: &mut fidl::encoding::Decoder<'_, D>,
1106            offset: usize,
1107            _depth: fidl::encoding::Depth,
1108        ) -> fidl::Result<()> {
1109            decoder.debug_check_bounds::<Self>(offset);
1110            // Verify that padding bytes are zero.
1111            fidl::decode!(fidl::encoding::Vector<u8, 256>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
1112            Ok(())
1113        }
1114    }
1115
1116    impl fidl::encoding::ValueTypeMarker for Signature {
1117        type Borrowed<'a> = &'a Self;
1118        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1119            value
1120        }
1121    }
1122
1123    unsafe impl fidl::encoding::TypeMarker for Signature {
1124        type Owned = Self;
1125
1126        #[inline(always)]
1127        fn inline_align(_context: fidl::encoding::Context) -> usize {
1128            8
1129        }
1130
1131        #[inline(always)]
1132        fn inline_size(_context: fidl::encoding::Context) -> usize {
1133            16
1134        }
1135    }
1136
1137    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Signature, D>
1138        for &Signature
1139    {
1140        #[inline]
1141        unsafe fn encode(
1142            self,
1143            encoder: &mut fidl::encoding::Encoder<'_, D>,
1144            offset: usize,
1145            _depth: fidl::encoding::Depth,
1146        ) -> fidl::Result<()> {
1147            encoder.debug_check_bounds::<Signature>(offset);
1148            // Delegate to tuple encoding.
1149            fidl::encoding::Encode::<Signature, D>::encode(
1150                (<fidl::encoding::Vector<u8, 512> as fidl::encoding::ValueTypeMarker>::borrow(
1151                    &self.bytes,
1152                ),),
1153                encoder,
1154                offset,
1155                _depth,
1156            )
1157        }
1158    }
1159    unsafe impl<
1160            D: fidl::encoding::ResourceDialect,
1161            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 512>, D>,
1162        > fidl::encoding::Encode<Signature, D> for (T0,)
1163    {
1164        #[inline]
1165        unsafe fn encode(
1166            self,
1167            encoder: &mut fidl::encoding::Encoder<'_, D>,
1168            offset: usize,
1169            depth: fidl::encoding::Depth,
1170        ) -> fidl::Result<()> {
1171            encoder.debug_check_bounds::<Signature>(offset);
1172            // Zero out padding regions. There's no need to apply masks
1173            // because the unmasked parts will be overwritten by fields.
1174            // Write the fields.
1175            self.0.encode(encoder, offset + 0, depth)?;
1176            Ok(())
1177        }
1178    }
1179
1180    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Signature {
1181        #[inline(always)]
1182        fn new_empty() -> Self {
1183            Self { bytes: fidl::new_empty!(fidl::encoding::Vector<u8, 512>, D) }
1184        }
1185
1186        #[inline]
1187        unsafe fn decode(
1188            &mut self,
1189            decoder: &mut fidl::encoding::Decoder<'_, D>,
1190            offset: usize,
1191            _depth: fidl::encoding::Depth,
1192        ) -> fidl::Result<()> {
1193            decoder.debug_check_bounds::<Self>(offset);
1194            // Verify that padding bytes are zero.
1195            fidl::decode!(fidl::encoding::Vector<u8, 512>, D, &mut self.bytes, decoder, offset + 0, _depth)?;
1196            Ok(())
1197        }
1198    }
1199
1200    impl fidl::encoding::ValueTypeMarker for StatelessKeyManagerGetHardwareDerivedKeyRequest {
1201        type Borrowed<'a> = &'a Self;
1202        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1203            value
1204        }
1205    }
1206
1207    unsafe impl fidl::encoding::TypeMarker for StatelessKeyManagerGetHardwareDerivedKeyRequest {
1208        type Owned = Self;
1209
1210        #[inline(always)]
1211        fn inline_align(_context: fidl::encoding::Context) -> usize {
1212            8
1213        }
1214
1215        #[inline(always)]
1216        fn inline_size(_context: fidl::encoding::Context) -> usize {
1217            16
1218        }
1219    }
1220
1221    unsafe impl<D: fidl::encoding::ResourceDialect>
1222        fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyRequest, D>
1223        for &StatelessKeyManagerGetHardwareDerivedKeyRequest
1224    {
1225        #[inline]
1226        unsafe fn encode(
1227            self,
1228            encoder: &mut fidl::encoding::Encoder<'_, D>,
1229            offset: usize,
1230            _depth: fidl::encoding::Depth,
1231        ) -> fidl::Result<()> {
1232            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyRequest>(offset);
1233            // Delegate to tuple encoding.
1234            fidl::encoding::Encode::<StatelessKeyManagerGetHardwareDerivedKeyRequest, D>::encode(
1235                (<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
1236                    &self.key_info,
1237                ),),
1238                encoder,
1239                offset,
1240                _depth,
1241            )
1242        }
1243    }
1244    unsafe impl<
1245            D: fidl::encoding::ResourceDialect,
1246            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
1247        > fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyRequest, D> for (T0,)
1248    {
1249        #[inline]
1250        unsafe fn encode(
1251            self,
1252            encoder: &mut fidl::encoding::Encoder<'_, D>,
1253            offset: usize,
1254            depth: fidl::encoding::Depth,
1255        ) -> fidl::Result<()> {
1256            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyRequest>(offset);
1257            // Zero out padding regions. There's no need to apply masks
1258            // because the unmasked parts will be overwritten by fields.
1259            // Write the fields.
1260            self.0.encode(encoder, offset + 0, depth)?;
1261            Ok(())
1262        }
1263    }
1264
1265    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1266        for StatelessKeyManagerGetHardwareDerivedKeyRequest
1267    {
1268        #[inline(always)]
1269        fn new_empty() -> Self {
1270            Self { key_info: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D) }
1271        }
1272
1273        #[inline]
1274        unsafe fn decode(
1275            &mut self,
1276            decoder: &mut fidl::encoding::Decoder<'_, D>,
1277            offset: usize,
1278            _depth: fidl::encoding::Depth,
1279        ) -> fidl::Result<()> {
1280            decoder.debug_check_bounds::<Self>(offset);
1281            // Verify that padding bytes are zero.
1282            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key_info, decoder, offset + 0, _depth)?;
1283            Ok(())
1284        }
1285    }
1286
1287    impl fidl::encoding::ValueTypeMarker for StatelessKeyManagerGetHardwareDerivedKeyResponse {
1288        type Borrowed<'a> = &'a Self;
1289        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1290            value
1291        }
1292    }
1293
1294    unsafe impl fidl::encoding::TypeMarker for StatelessKeyManagerGetHardwareDerivedKeyResponse {
1295        type Owned = Self;
1296
1297        #[inline(always)]
1298        fn inline_align(_context: fidl::encoding::Context) -> usize {
1299            8
1300        }
1301
1302        #[inline(always)]
1303        fn inline_size(_context: fidl::encoding::Context) -> usize {
1304            16
1305        }
1306    }
1307
1308    unsafe impl<D: fidl::encoding::ResourceDialect>
1309        fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyResponse, D>
1310        for &StatelessKeyManagerGetHardwareDerivedKeyResponse
1311    {
1312        #[inline]
1313        unsafe fn encode(
1314            self,
1315            encoder: &mut fidl::encoding::Encoder<'_, D>,
1316            offset: usize,
1317            _depth: fidl::encoding::Depth,
1318        ) -> fidl::Result<()> {
1319            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyResponse>(offset);
1320            // Delegate to tuple encoding.
1321            fidl::encoding::Encode::<StatelessKeyManagerGetHardwareDerivedKeyResponse, D>::encode(
1322                (<fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
1323                    &self.derived_key,
1324                ),),
1325                encoder,
1326                offset,
1327                _depth,
1328            )
1329        }
1330    }
1331    unsafe impl<
1332            D: fidl::encoding::ResourceDialect,
1333            T0: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
1334        > fidl::encoding::Encode<StatelessKeyManagerGetHardwareDerivedKeyResponse, D> for (T0,)
1335    {
1336        #[inline]
1337        unsafe fn encode(
1338            self,
1339            encoder: &mut fidl::encoding::Encoder<'_, D>,
1340            offset: usize,
1341            depth: fidl::encoding::Depth,
1342        ) -> fidl::Result<()> {
1343            encoder.debug_check_bounds::<StatelessKeyManagerGetHardwareDerivedKeyResponse>(offset);
1344            // Zero out padding regions. There's no need to apply masks
1345            // because the unmasked parts will be overwritten by fields.
1346            // Write the fields.
1347            self.0.encode(encoder, offset + 0, depth)?;
1348            Ok(())
1349        }
1350    }
1351
1352    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1353        for StatelessKeyManagerGetHardwareDerivedKeyResponse
1354    {
1355        #[inline(always)]
1356        fn new_empty() -> Self {
1357            Self { derived_key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D) }
1358        }
1359
1360        #[inline]
1361        unsafe fn decode(
1362            &mut self,
1363            decoder: &mut fidl::encoding::Decoder<'_, D>,
1364            offset: usize,
1365            _depth: fidl::encoding::Depth,
1366        ) -> fidl::Result<()> {
1367            decoder.debug_check_bounds::<Self>(offset);
1368            // Verify that padding bytes are zero.
1369            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.derived_key, decoder, offset + 0, _depth)?;
1370            Ok(())
1371        }
1372    }
1373}