pub struct Rar5EncryptionInfo {
pub version: u8,
pub flags: u8,
pub lg2_count: u8,
pub salt: [u8; 16],
pub init_v: [u8; 16],
pub psw_check: Option<[u8; 8]>,
pub psw_check_sum: Option<[u8; 4]>,
}Expand description
RAR5 encryption information parsed from file header.
Fields§
§version: u8Encryption version (must be 0)
flags: u8Flags (0x01 = password check present, 0x02 = use MAC for checksums)
lg2_count: u8Log2 of PBKDF2 iteration count
salt: [u8; 16]16-byte salt
init_v: [u8; 16]16-byte initialization vector
psw_check: Option<[u8; 8]>Optional 8-byte password check value
psw_check_sum: Option<[u8; 4]>Optional 4-byte password check sum
Implementations§
Source§impl Rar5EncryptionInfo
impl Rar5EncryptionInfo
Sourcepub fn parse(data: &[u8]) -> Result<Self, CryptoError>
pub fn parse(data: &[u8]) -> Result<Self, CryptoError>
Parse encryption info from extra data. Format:
- vint: version
- vint: flags
- 1 byte: lg2_count
- 16 bytes: salt
- 16 bytes: init_v
- if flags & 0x01:
- 8 bytes: psw_check
- 4 bytes: psw_check_sum (SHA-256 of psw_check, first 4 bytes)
Trait Implementations§
Source§impl Clone for Rar5EncryptionInfo
impl Clone for Rar5EncryptionInfo
Source§fn clone(&self) -> Rar5EncryptionInfo
fn clone(&self) -> Rar5EncryptionInfo
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 Rar5EncryptionInfo
impl Debug for Rar5EncryptionInfo
Source§impl PartialEq for Rar5EncryptionInfo
impl PartialEq for Rar5EncryptionInfo
impl Eq for Rar5EncryptionInfo
impl StructuralPartialEq for Rar5EncryptionInfo
Auto Trait Implementations§
impl Freeze for Rar5EncryptionInfo
impl RefUnwindSafe for Rar5EncryptionInfo
impl Send for Rar5EncryptionInfo
impl Sync for Rar5EncryptionInfo
impl Unpin for Rar5EncryptionInfo
impl UnwindSafe for Rar5EncryptionInfo
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