use low mem for all argon2 configs (#2491)

* reduce argon2 memory usage

* update FE argon2

* fix missing typedefs

* use low mem for all argon2 configs
This commit is contained in:
Aiden McClelland
2023-11-01 16:28:59 -06:00
committed by GitHub
parent 1dad7965d2
commit 27c5464cb6
3 changed files with 3 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ fn hash_password(password: &str) -> Result<String, Error> {
argon2::hash_encoded( argon2::hash_encoded(
password.as_bytes(), password.as_bytes(),
&rand::random::<[u8; 16]>()[..], &rand::random::<[u8; 16]>()[..],
&argon2::Config::default(), &argon2::Config::rfc9106_low_mem(),
) )
.with_kind(crate::ErrorKind::PasswordHashGeneration) .with_kind(crate::ErrorKind::PasswordHashGeneration)
} }

View File

@@ -84,7 +84,7 @@ fn gen_pwd() {
argon2::hash_encoded( argon2::hash_encoded(
b"testing1234", b"testing1234",
&rand::random::<[u8; 16]>()[..], &rand::random::<[u8; 16]>()[..],
&argon2::Config::default() &argon2::Config::rfc9106_low_mem()
) )
.unwrap() .unwrap()
) )

View File

@@ -189,7 +189,7 @@ pub async fn recover_full_embassy(
os_backup.account.password = argon2::hash_encoded( os_backup.account.password = argon2::hash_encoded(
embassy_password.as_bytes(), embassy_password.as_bytes(),
&rand::random::<[u8; 16]>()[..], &rand::random::<[u8; 16]>()[..],
&argon2::Config::default(), &argon2::Config::rfc9106_low_mem(),
) )
.with_kind(ErrorKind::PasswordHashGeneration)?; .with_kind(ErrorKind::PasswordHashGeneration)?;