pub struct ScryptParams<'a> {
pub salt: &'a [u8],
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: &'a [u8]scrypt 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<'a> ScryptParams<'a>
impl<'a> ScryptParams<'a>
Sourcepub fn from_params_and_salt(params: Params, salt: &'a [u8]) -> Result<Self>
pub fn from_params_and_salt(params: Params, salt: &'a [u8]) -> Result<Self>
Get the ScryptParams for the provided upstream scrypt::Params
and a provided salt string.
Trait Implementations§
Source§impl<'a> Clone for ScryptParams<'a>
impl<'a> Clone for ScryptParams<'a>
Source§fn clone(&self) -> ScryptParams<'a>
fn clone(&self) -> ScryptParams<'a>
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<'a> Debug for ScryptParams<'a>
impl<'a> Debug for ScryptParams<'a>
Source§impl<'a> DecodeValue<'a> for ScryptParams<'a>
impl<'a> DecodeValue<'a> for ScryptParams<'a>
Source§impl EncodeValue for ScryptParams<'_>
impl EncodeValue for ScryptParams<'_>
Source§impl<'a> From<ScryptParams<'a>> for Kdf<'a>
impl<'a> From<ScryptParams<'a>> for Kdf<'a>
Source§fn from(params: ScryptParams<'a>) -> Self
fn from(params: ScryptParams<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a> PartialEq for ScryptParams<'a>
impl<'a> PartialEq for ScryptParams<'a>
Source§impl<'a> TryFrom<&ScryptParams<'a>> for Params
Available on crate feature pbes2 only.
impl<'a> TryFrom<&ScryptParams<'a>> for Params
Available on crate feature
pbes2 only.Source§impl<'a> TryFrom<AnyRef<'a>> for ScryptParams<'a>
impl<'a> TryFrom<AnyRef<'a>> for ScryptParams<'a>
Source§impl<'a> TryFrom<ScryptParams<'a>> for Params
Available on crate feature pbes2 only.
impl<'a> TryFrom<ScryptParams<'a>> for Params
Available on crate feature
pbes2 only.impl<'a> Copy for ScryptParams<'a>
impl<'a> Eq for ScryptParams<'a>
impl<'a> Sequence<'a> for ScryptParams<'a>
impl<'a> StructuralPartialEq for ScryptParams<'a>
Auto Trait Implementations§
impl<'a> Freeze for ScryptParams<'a>
impl<'a> RefUnwindSafe for ScryptParams<'a>
impl<'a> Send for ScryptParams<'a>
impl<'a> Sync for ScryptParams<'a>
impl<'a> Unpin for ScryptParams<'a>
impl<'a> UnsafeUnpin for ScryptParams<'a>
impl<'a> UnwindSafe for ScryptParams<'a>
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,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
Source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
Source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer.
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 value to the provided byte slice, returning a sub-slice
containing the encoded message.