pub struct ScryptParams {
pub salt: Salt,
pub cost_parameter: u64,
pub block_size: u16,
pub parallelization: u16,
pub key_length: Option<u16>,
}Expand description
scrypt parameters as defined in RFC 7914 Section 7.1.
scrypt-params ::= SEQUENCE {
salt OCTET STRING,
costParameter INTEGER (1..MAX),
blockSize INTEGER (1..MAX),
parallelizationParameter INTEGER (1..MAX),
keyLength INTEGER (1..MAX) OPTIONAL
}Fields§
§salt: Saltscrypt salt
cost_parameter: u64CPU/Memory cost parameter N.
block_size: u16Block size parameter r.
parallelization: u16Parallelization parameter p.
key_length: Option<u16>PBKDF2 output length
Implementations§
Source§impl ScryptParams
impl ScryptParams
Sourcepub fn from_params_and_salt(params: Params, salt: &[u8]) -> Result<Self>
pub fn from_params_and_salt(params: Params, salt: &[u8]) -> Result<Self>
Get the ScryptParams for the provided upstream scrypt::Params
and a provided salt string.
§Errors
Returns Error::AlgorithmParametersInvalid if the parameters are invalid.
Trait Implementations§
Source§impl Clone for ScryptParams
impl Clone for ScryptParams
impl Copy for ScryptParams
Source§impl Debug for ScryptParams
impl Debug for ScryptParams
Source§impl<'a> DecodeValue<'a> for ScryptParams
impl<'a> DecodeValue<'a> for ScryptParams
Source§impl EncodeValue for ScryptParams
impl EncodeValue for ScryptParams
impl Eq for ScryptParams
Source§impl From<ScryptParams> for Kdf
impl From<ScryptParams> for Kdf
Source§fn from(params: ScryptParams) -> Self
fn from(params: ScryptParams) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ScryptParams
impl PartialEq for ScryptParams
impl Sequence<'_> for ScryptParams
impl StructuralPartialEq for ScryptParams
Source§impl TryFrom<&ScryptParams> for Params
Available on crate feature pbes2 only.
impl TryFrom<&ScryptParams> for Params
Available on crate feature
pbes2 only.Source§impl TryFrom<AnyRef<'_>> for ScryptParams
impl TryFrom<AnyRef<'_>> for ScryptParams
Auto Trait Implementations§
impl Freeze for ScryptParams
impl RefUnwindSafe for ScryptParams
impl Send for ScryptParams
impl Sync for ScryptParams
impl Unpin for ScryptParams
impl UnsafeUnpin for ScryptParams
impl UnwindSafe for ScryptParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag + 'a,
Source§type Error = <T as DecodeValue<'a>>::Error
type Error = <T as DecodeValue<'a>>::Error
Type returned in the event of a decoding error.
Source§fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
fn decode<R>(reader: &mut R) -> Result<T, <T as DecodeValue<'a>>::Error>where
R: Reader<'a>,
Attempt to decode this TLV message using the provided decoder. Read more
impl<T> DecodeOwned for Twhere
T: for<'a> Decode<'a>,
Source§impl<T> Encode for T
impl<T> Encode for T
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this TLV object in bytes when encoded as ASN.1 DER. Read more
Source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this TLV object to the provided byte slice, returning a sub-slice
containing the encoded message. Read more
Source§impl<T> IsConstructed for T
impl<T> IsConstructed for T
Source§const CONSTRUCTED: bool
const CONSTRUCTED: bool
ASN.1 constructed bit