#[non_exhaustive]pub enum Pbkdf2Error {
InvalidIterations,
OutputTooLong,
}Available on (crate features
hmac or hkdf or kmac or ed25519 or x25519 or phc-strings or argon2 or scrypt) and crate feature pbkdf2 only.Expand description
Invalid PBKDF2 parameters.
Returned when the iteration count is zero or the derived key length exceeds
the RFC 2898 maximum of (2^32 − 1) × hLen.
§Examples
use rscrypto::{Pbkdf2Sha256, auth::Pbkdf2Error};
let err = Pbkdf2Sha256::derive_key(b"pw", b"salt", 0, &mut [0u8; 32]);
assert_eq!(err, Err(Pbkdf2Error::InvalidIterations));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidIterations
The iteration count must be at least 1. NIST/OWASP policy minima are documented on
Pbkdf2Sha256::MIN_RECOMMENDED_ITERATIONS and
Pbkdf2Sha512::MIN_RECOMMENDED_ITERATIONS.
OutputTooLong
The requested output length exceeds (2^32 − 1) × hLen.
Trait Implementations§
Source§impl Clone for Pbkdf2Error
impl Clone for Pbkdf2Error
Source§fn clone(&self) -> Pbkdf2Error
fn clone(&self) -> Pbkdf2Error
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 Pbkdf2Error
impl Debug for Pbkdf2Error
Source§impl Display for Pbkdf2Error
impl Display for Pbkdf2Error
Source§impl Error for Pbkdf2Error
impl Error for Pbkdf2Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl Hash for Pbkdf2Error
impl Hash for Pbkdf2Error
Source§impl PartialEq for Pbkdf2Error
impl PartialEq for Pbkdf2Error
impl Copy for Pbkdf2Error
impl Eq for Pbkdf2Error
impl StructuralPartialEq for Pbkdf2Error
Auto Trait Implementations§
impl Freeze for Pbkdf2Error
impl RefUnwindSafe for Pbkdf2Error
impl Send for Pbkdf2Error
impl Sync for Pbkdf2Error
impl Unpin for Pbkdf2Error
impl UnsafeUnpin for Pbkdf2Error
impl UnwindSafe for Pbkdf2Error
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more