Doc: Add Panic ection to high-level newtypes regarding default(). Add missing re-wording from Exceptions to Errors
@@ -34,12 +34,16 @@ construct_secret_key_variable_size! {
/// handle a failing CSPRNG. If the CSPRNG fails, that function panics. If handling a failing CSPRNG's
/// error is needed, use instead `generate()`.
///
- /// # Exceptions:
- /// An exception will be thrown if:
+ /// # Errors:
+ /// An error will be returned if:
/// - `slice` is empty.
- /// - The `OsRng` fails to initialize or read from its source.
+ /// - The `OsRng` fails to initialize or read from its source when using `SecretKey::generate()`.
/// - `length` is 0.
/// - `length` is not less than `u32::max_value()`.
+ ///
+ /// # Panics:
+ /// A panic will occur if:
+ /// - The `OsRng` fails to initialize or read from its source when using `SecretKey::default()`.
(SecretKey, 32)
}
@@ -53,12 +57,16 @@ construct_salt_variable_size! {
/// handle a failing CSPRNG. If the CSPRNG fails, that function panics. If handling a failing CSPRNG's
/// error is needed, use instead `generate()`.
///
- /// # Exceptions:
- /// An exception will be thrown if:
+ /// # Errors:
+ /// An error will be returned if:
/// - `slice` is empty.
- /// - The `OsRng` fails to initialize or read from its source.
+ /// - The `OsRng` fails to initialize or read from its source when using `Salt::generate()`.
/// - `length` is 0.
/// - `length` is not less than `u32::max_value()`.
+ ///
+ /// # Panics:
+ /// A panic will occur if:
+ /// - The `OsRng` fails to initialize or read from its source when using `Salt::default()`.
(Salt, 64)
}
@@ -68,8 +76,8 @@ construct_tag! {
/// A `PasswordHash`'s first 64 bytes are the salt used to hash the password, and the last 64
/// bytes are the actual password hash.
///
- /// # Exceptions:
- /// An exception will be thrown if:
+ /// # Errors:
+ /// An error will be returned if:
/// - `slice` is not 128 bytes.
(PasswordHash, 128)
}
@@ -78,10 +86,10 @@ construct_password_variable_size! {
/// A type to represent the `Password` that PBKDF2 hashes and uses for key derivation.
///
///
- /// # Exceptions:
- /// An exception will be thrown if:
+ /// # Errors:
+ /// An error will be returned if:
/// - `slice` is empty.
- /// - The `OsRng` fails to initialize or read from its source.
+ /// - The `OsRng` fails to initialize or read from its source when using `Password::generate()`.
/// - `length` is 0.
/// - `length` is not less than `u32::max_value()`.
(Password)
