pub struct TdxKeyPolicy(/* private fields */);Expand description
Selects which TD-specific measurement and configuration registers are mixed
into the key derived by the TDG.MR.KEY.GET TDCALL. This is the analog of
SNP’s GuestFieldSelect.
See TDKEYPOLICY, Table 2-2, “System Architecture Specification: Sealing
Support for Intel TDX”, Revision 0.7, September 2025.
Implementations§
Source§impl TdxKeyPolicy
impl TdxKeyPolicy
Sourcepub const fn with_mr_td_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mr_td_checked(self, value: bool) -> Result<Self, ()>
Include MRTD (bit 0).
Bits: 0..1
Sourcepub const fn with_mr_td(self, value: bool) -> Self
pub const fn with_mr_td(self, value: bool) -> Self
Include MRTD (bit 0).
Bits: 0..1
Sourcepub const fn set_mr_td_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mr_td_checked(&mut self, value: bool) -> Result<(), ()>
Include MRTD (bit 0).
Bits: 0..1
Sourcepub const fn with_mr_owner_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mr_owner_checked(self, value: bool) -> Result<Self, ()>
Include MROWNER (bit 2).
Bits: 2..3
Sourcepub const fn with_mr_owner(self, value: bool) -> Self
pub const fn with_mr_owner(self, value: bool) -> Self
Include MROWNER (bit 2).
Bits: 2..3
Sourcepub const fn set_mr_owner(&mut self, value: bool)
pub const fn set_mr_owner(&mut self, value: bool)
Include MROWNER (bit 2).
Bits: 2..3
Sourcepub const fn set_mr_owner_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mr_owner_checked(&mut self, value: bool) -> Result<(), ()>
Include MROWNER (bit 2).
Bits: 2..3
Sourcepub const fn mr_config_id(&self) -> bool
pub const fn mr_config_id(&self) -> bool
Include MRCONFIGID (bit 3).
Bits: 3..4
Sourcepub const fn with_mr_config_id_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mr_config_id_checked(self, value: bool) -> Result<Self, ()>
Include MRCONFIGID (bit 3).
Bits: 3..4
Sourcepub const fn with_mr_config_id(self, value: bool) -> Self
pub const fn with_mr_config_id(self, value: bool) -> Self
Include MRCONFIGID (bit 3).
Bits: 3..4
Sourcepub const fn set_mr_config_id(&mut self, value: bool)
pub const fn set_mr_config_id(&mut self, value: bool)
Include MRCONFIGID (bit 3).
Bits: 3..4
Sourcepub const fn set_mr_config_id_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_mr_config_id_checked(&mut self, value: bool) -> Result<(), ()>
Include MRCONFIGID (bit 3).
Bits: 3..4
Sourcepub const fn mr_owner_config(&self) -> bool
pub const fn mr_owner_config(&self) -> bool
Include MROWNERCONFIG (bit 4).
Bits: 4..5
Sourcepub const fn with_mr_owner_config_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_mr_owner_config_checked(self, value: bool) -> Result<Self, ()>
Include MROWNERCONFIG (bit 4).
Bits: 4..5
Sourcepub const fn with_mr_owner_config(self, value: bool) -> Self
pub const fn with_mr_owner_config(self, value: bool) -> Self
Include MROWNERCONFIG (bit 4).
Bits: 4..5
Sourcepub const fn set_mr_owner_config(&mut self, value: bool)
pub const fn set_mr_owner_config(&mut self, value: bool)
Include MROWNERCONFIG (bit 4).
Bits: 4..5
Sourcepub const fn set_mr_owner_config_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_mr_owner_config_checked( &mut self, value: bool, ) -> Result<(), ()>
Include MROWNERCONFIG (bit 4).
Bits: 4..5
Sourcepub const fn rtmr(&self) -> u16
pub const fn rtmr(&self) -> u16
RTMR selection (bits 47:32). Bits 4:0 select RTMR n, bits 7:5 are
reserved and must be zero.
Bits: 32..48
Sourcepub const fn with_rtmr_checked(self, value: u16) -> Result<Self, ()>
pub const fn with_rtmr_checked(self, value: u16) -> Result<Self, ()>
RTMR selection (bits 47:32). Bits 4:0 select RTMR n, bits 7:5 are
reserved and must be zero.
Bits: 32..48
Sourcepub const fn with_rtmr(self, value: u16) -> Self
pub const fn with_rtmr(self, value: u16) -> Self
RTMR selection (bits 47:32). Bits 4:0 select RTMR n, bits 7:5 are
reserved and must be zero.
Bits: 32..48
Trait Implementations§
Source§impl Clone for TdxKeyPolicy
impl Clone for TdxKeyPolicy
Source§fn clone(&self) -> TdxKeyPolicy
fn clone(&self) -> TdxKeyPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TdxKeyPolicy
impl Debug for TdxKeyPolicy
Source§impl Default for TdxKeyPolicy
impl Default for TdxKeyPolicy
Source§impl From<TdxKeyPolicy> for u64
impl From<TdxKeyPolicy> for u64
Source§fn from(v: TdxKeyPolicy) -> u64
fn from(v: TdxKeyPolicy) -> u64
Source§impl From<u64> for TdxKeyPolicy
impl From<u64> for TdxKeyPolicy
Source§impl FromBytes for TdxKeyPolicywhere
u64: FromBytes,
impl FromBytes for TdxKeyPolicywhere
u64: FromBytes,
§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
&Self. Read more§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§impl FromZeros for TdxKeyPolicywhere
u64: FromZeros,
impl FromZeros for TdxKeyPolicywhere
u64: FromZeros,
§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere
Self: Sized,
Self from zeroed bytes. Read more§fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
Box<Self> from zeroed bytes. Read more§fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
Vec<Self> from zeroed bytes. Read moreSource§impl IntoBytes for TdxKeyPolicywhere
u64: IntoBytes,
impl IntoBytes for TdxKeyPolicywhere
u64: IntoBytes,
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl KnownLayout for TdxKeyPolicywhere
Self: Sized,
impl KnownLayout for TdxKeyPolicywhere
Self: Sized,
Source§type PointerMetadata = ()
type PointerMetadata = ()
Self. Read more§fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
fn size_for_metadata(meta: Self::PointerMetadata) -> Option<usize>
Self with the given pointer
metadata. Read more