@@ -77,7 +77,7 @@ impl<Ids: KeyIds> PasswordProtectedKeyEnvelope<Ids> {
77
77
Self :: seal_ref_with_settings (
78
78
key_to_seal,
79
79
password,
80
- & Argon2RawSettings :: default_for_platform ( ) ,
80
+ & Argon2RawSettings :: local_kdf_settings ( ) ,
81
81
)
82
82
}
83
83
@@ -262,9 +262,9 @@ struct Argon2RawSettings {
262
262
}
263
263
264
264
impl Argon2RawSettings {
265
- /// Creates default Argon2 settings based on the platform . This currently is a static preset
265
+ /// Creates default Argon2 settings based on the device . This currently is a static preset
266
266
/// based on the target os
267
- fn default_for_platform ( ) -> Self {
267
+ fn local_kdf_settings ( ) -> Self {
268
268
// iOS has memory limitations in the auto-fill context. So, the memory is halved
269
269
// but the iterations are doubled
270
270
if cfg ! ( target_os = "ios" ) {
@@ -310,8 +310,13 @@ impl TryInto<Params> for &Argon2RawSettings {
310
310
type Error = PasswordProtectedKeyEnvelopeError ;
311
311
312
312
fn try_into ( self ) -> Result < Params , PasswordProtectedKeyEnvelopeError > {
313
- Params :: new ( self . memory , self . iterations , self . parallelism , Some ( 32 ) )
314
- . map_err ( |_| PasswordProtectedKeyEnvelopeError :: KdfError )
313
+ Params :: new (
314
+ self . memory ,
315
+ self . iterations ,
316
+ self . parallelism ,
317
+ Some ( ENVELOPE_ARGON2_OUTPUT_KEY_SIZE ) ,
318
+ )
319
+ . map_err ( |_| PasswordProtectedKeyEnvelopeError :: KdfError )
315
320
}
316
321
}
317
322
0 commit comments