pub struct Luks1Header {
pub version: u16,
pub cipher_name: String,
pub cipher_mode: String,
pub hash_spec: String,
pub payload_offset: u32,
pub key_bytes: u32,
pub mk_digest: [u8; 20],
pub mk_digest_salt: [u8; 32],
pub mk_digest_iter: u32,
pub uuid: String,
pub keyslots: [Keyslot; 8],
}Expand description
A parsed LUKS1 partition header.
Fields§
§version: u16Header version (always 1 here).
cipher_name: StringCipher name, e.g. aes.
cipher_mode: StringCipher mode, e.g. xts-plain64.
hash_spec: StringHash spec for PBKDF2 and AF, e.g. sha256.
payload_offset: u32Payload start, in 512-byte sectors.
key_bytes: u32Master-key length in bytes (e.g. 64 for AES-256-XTS).
mk_digest: [u8; 20]Master-key digest (PBKDF2 of the master key).
mk_digest_salt: [u8; 32]Salt for the master-key digest.
mk_digest_iter: u32Iteration count for the master-key digest.
uuid: StringVolume UUID.
keyslots: [Keyslot; 8]The eight keyslots.
Implementations§
Source§impl Luks1Header
impl Luks1Header
Sourcepub fn parse(data: &[u8]) -> Result<Self>
pub fn parse(data: &[u8]) -> Result<Self>
Parse a LUKS1 header from the first LUKS1_PHDR_LEN bytes of data.
§Errors
LuksError::NotLuks if the magic is absent, LuksError::UnsupportedVersion
if the version is not 1, LuksError::MalformedHeader if the buffer is short.
Sourcepub fn active_keyslots(&self) -> impl Iterator<Item = &Keyslot>
pub fn active_keyslots(&self) -> impl Iterator<Item = &Keyslot>
The active keyslots, in slot order.
Sourcepub fn payload_byte_offset(&self) -> u64
pub fn payload_byte_offset(&self) -> u64
Payload byte offset (payload_offset * 512).
Trait Implementations§
Source§impl Clone for Luks1Header
impl Clone for Luks1Header
Source§fn clone(&self) -> Luks1Header
fn clone(&self) -> Luks1Header
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Luks1Header
impl RefUnwindSafe for Luks1Header
impl Send for Luks1Header
impl Sync for Luks1Header
impl Unpin for Luks1Header
impl UnsafeUnpin for Luks1Header
impl UnwindSafe for Luks1Header
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