Updated to Rust 1.80 and changed to LazyLock
This commit is contained in:
parent
4121857854
commit
5c789533e3
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -1078,9 +1078,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.36.1"
|
||||
version = "0.36.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
|
||||
checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
@ -1090,9 +1090,6 @@ name = "once_cell"
|
||||
version = "1.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
dependencies = [
|
||||
"parking_lot_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "opaque-debug"
|
||||
@ -1150,7 +1147,6 @@ dependencies = [
|
||||
"futures",
|
||||
"hex",
|
||||
"itertools 0.13.0",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"pbkdf2",
|
||||
"rand",
|
||||
|
@ -29,7 +29,6 @@ dotenvy = "0.15"
|
||||
futures = "0.3"
|
||||
hex = "0.4"
|
||||
itertools = "0.13"
|
||||
once_cell = { version = "1", features = ["parking_lot"] }
|
||||
parking_lot = "0.12"
|
||||
pbkdf2 = { version = "0.12", features = ["parallel"] }
|
||||
rand = { version = "0.8", default-features = false, features = [
|
||||
|
@ -107,10 +107,10 @@ impl Decrypted {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use once_cell::sync::Lazy;
|
||||
use std::sync::LazyLock;
|
||||
|
||||
const TESTING_MASTER_PASSWORD: &str = "VeryStr^n#M@$terP@$$!word";
|
||||
static CIPHER: Lazy<Cipher> = Lazy::new(|| {
|
||||
static CIPHER: LazyLock<Cipher> = LazyLock::new(|| {
|
||||
let mut salt = [0; 64];
|
||||
OsRng.fill_bytes(&mut salt);
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
use crate::entity::master_pass::MasterPass;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{rngs::OsRng, RngCore};
|
||||
use scrypt::{scrypt, Params};
|
||||
use std::sync::LazyLock;
|
||||
use subtle::ConstantTimeEq;
|
||||
|
||||
pub const HASH_LENGTH: usize = 64;
|
||||
pub const SALT_LENGTH: usize = 64;
|
||||
|
||||
static PARAMS: Lazy<Params> = Lazy::new(|| Params::new(14, 8, 1, HASH_LENGTH).unwrap());
|
||||
static PARAMS: LazyLock<Params> = LazyLock::new(|| Params::new(14, 8, 1, HASH_LENGTH).unwrap());
|
||||
|
||||
/// Hashes the bytes with Scrypt with the given salt
|
||||
#[must_use]
|
||||
|
Loading…
Reference in New Issue
Block a user