#[non_exhaustive]pub enum ScryptError {
InvalidLogN,
InvalidR,
InvalidP,
InvalidOutputLen,
ResourceOverflow,
AllocationFailed,
EntropyUnavailable,
}Available on (crate features
hmac or hkdf or kmac or ed25519 or x25519 or phc-strings or argon2 or scrypt) and crate feature scrypt only.Expand description
Invalid scrypt parameter, input length, or resource constraint.
Surfaced at build or hash time — never at verify time (a parameter
error during verification would leak information about the stored hash,
so verify collapses these into crate::VerificationError).
§Examples
use rscrypto::{ScryptParams, auth::scrypt::ScryptError};
assert_eq!(
ScryptParams::new().log_n(0).build().unwrap_err(),
ScryptError::InvalidLogN,
);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.
InvalidLogN
log_n must be in 1..=63 (N must be a power of two greater than 1).
InvalidR
r must be at least 1.
InvalidP
p must be at least 1 and satisfy r · p ≤ 2^30 − 1.
InvalidOutputLen
output_len must be at least MIN_OUTPUT_LEN.
ResourceOverflow
The requested working-set size overflows the address space of the
target. Typically means log_n is too large for a 32-bit target.
AllocationFailed
The allocator refused to provide the working-set buffers.
The platform entropy source failed while generating a PHC salt.
Trait Implementations§
Source§impl Clone for ScryptError
impl Clone for ScryptError
Source§fn clone(&self) -> ScryptError
fn clone(&self) -> ScryptError
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 ScryptError
impl Debug for ScryptError
Source§impl Display for ScryptError
impl Display for ScryptError
Source§impl Error for ScryptError
impl Error for ScryptError
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 ScryptError
impl Hash for ScryptError
Source§impl PartialEq for ScryptError
impl PartialEq for ScryptError
impl Copy for ScryptError
impl Eq for ScryptError
impl StructuralPartialEq for ScryptError
Auto Trait Implementations§
impl Freeze for ScryptError
impl RefUnwindSafe for ScryptError
impl Send for ScryptError
impl Sync for ScryptError
impl Unpin for ScryptError
impl UnsafeUnpin for ScryptError
impl UnwindSafe for ScryptError
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