#[repr(C)]pub struct KernelBinding {
pub manifest_root_hash: [u8; 32],
pub policy_hash: [u8; 32],
pub binding_version: u16,
pub min_runtime_version: u16,
pub _pad0: u32,
pub allowed_segment_mask: u64,
pub _reserved: [u8; 48],
}Expand description
128-byte kernel binding record (padded for future evolution).
Layout:
| Offset | Size | Field |
|---|---|---|
| 0x00 | 32 | manifest_root_hash |
| 0x20 | 32 | policy_hash |
| 0x40 | 2 | binding_version |
| 0x42 | 2 | min_runtime_version |
| 0x44 | 4 | _pad0 (alignment) |
| 0x48 | 8 | allowed_segment_mask |
| 0x50 | 48 | _reserved |
All multi-byte fields are little-endian on the wire.
Fields§
§manifest_root_hash: [u8; 32]SHAKE-256-256 of the manifest root node.
policy_hash: [u8; 32]SHAKE-256-256 of the policy document.
binding_version: u16Binding format version (currently 1).
min_runtime_version: u16Minimum runtime version required (0 = any).
_pad0: u32Alignment padding (must be zero).
allowed_segment_mask: u64Bitmask of allowed segment types (0 = no restriction).
_reserved: [u8; 48]Reserved for future use (must be zero).
Implementations§
Source§impl KernelBinding
impl KernelBinding
Sourcepub fn from_bytes(data: &[u8; 128]) -> Self
pub fn from_bytes(data: &[u8; 128]) -> Self
Deserialize a KernelBinding from a 128-byte slice (unchecked).
Does NOT validate reserved fields. Use from_bytes_validated for
security-critical paths that must reject non-zero padding/reserved.
Sourcepub fn from_bytes_validated(data: &[u8; 128]) -> Result<Self, &'static str>
pub fn from_bytes_validated(data: &[u8; 128]) -> Result<Self, &'static str>
Deserialize and validate a KernelBinding from a 128-byte slice.
Rejects bindings where:
binding_versionis 0 (uninitialized)_pad0is non-zero (spec violation)_reservedcontains non-zero bytes (spec violation / data smuggling)
Trait Implementations§
Source§impl Clone for KernelBinding
impl Clone for KernelBinding
Source§fn clone(&self) -> KernelBinding
fn clone(&self) -> KernelBinding
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelBinding
impl Debug for KernelBinding
Source§impl PartialEq for KernelBinding
impl PartialEq for KernelBinding
impl Copy for KernelBinding
impl Eq for KernelBinding
impl StructuralPartialEq for KernelBinding
Auto Trait Implementations§
impl Freeze for KernelBinding
impl RefUnwindSafe for KernelBinding
impl Send for KernelBinding
impl Sync for KernelBinding
impl Unpin for KernelBinding
impl UnwindSafe for KernelBinding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more