pub struct KeyDerivationConfig {
pub algorithm: String,
pub iterations: u32,
pub salt_len: usize,
pub key_len: usize,
pub memory_kb: Option<u32>,
pub parallelism: Option<u32>,
}Expand description
密钥派生函数参数
Fields§
§algorithm: String派生函数名称(pbkdf2 / argon2id / scrypt)
iterations: u32迭代次数
salt_len: usize盐长度(字节)
key_len: usize派生密钥长度(字节)
memory_kb: Option<u32>内存参数(Argon2 专用,单位 KB)
parallelism: Option<u32>并行度(Argon2 专用)
Implementations§
Source§impl KeyDerivationConfig
impl KeyDerivationConfig
Sourcepub fn generate_salt(&self) -> Vec<u8> ⓘ
pub fn generate_salt(&self) -> Vec<u8> ⓘ
生成随机盐
Trait Implementations§
Source§impl Clone for KeyDerivationConfig
impl Clone for KeyDerivationConfig
Source§fn clone(&self) -> KeyDerivationConfig
fn clone(&self) -> KeyDerivationConfig
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 moreSource§impl Debug for KeyDerivationConfig
impl Debug for KeyDerivationConfig
Source§impl Default for KeyDerivationConfig
impl Default for KeyDerivationConfig
Source§impl<'de> Deserialize<'de> for KeyDerivationConfig
impl<'de> Deserialize<'de> for KeyDerivationConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeyDerivationConfig
impl RefUnwindSafe for KeyDerivationConfig
impl Send for KeyDerivationConfig
impl Sync for KeyDerivationConfig
impl Unpin for KeyDerivationConfig
impl UnsafeUnpin for KeyDerivationConfig
impl UnwindSafe for KeyDerivationConfig
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