pub struct RandomMaterial {
pub file_uuid: [u8; 16],
pub base_nonce: [u8; 7],
pub slot_padding: Option<Vec<u8>>,
}Expand description
加密所需的随机材料。
单独抽出来是为了让加密过程可确定性复现——测试向量验证要求「相同输入加相同 随机源产出逐字节相同输出」,若随机数在函数内部生成就无法做到。
Fields§
§file_uuid: [u8; 16]文件唯一标识。
base_nonce: [u8; 7]载荷 nonce 前缀。
slot_padding: Option<Vec<u8>>未使用 slot 的填充字节。为 None 时现场生成随机值。
Implementations§
Trait Implementations§
Source§impl Clone for RandomMaterial
impl Clone for RandomMaterial
Auto Trait Implementations§
impl Forget for RandomMaterial
impl Freeze for RandomMaterial
impl RefUnwindSafe for RandomMaterial
impl Send for RandomMaterial
impl Sync for RandomMaterial
impl Unpin for RandomMaterial
impl UnsafeUnpin for RandomMaterial
impl UnwindSafe for RandomMaterial
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