mirror of
https://github.com/bitwarden/mobile
synced 2025-12-24 04:04:34 +00:00
* Implement kdf configuration * Remove unused import * Move kdf parameters to kdfConfiguration struct * Remove unused state migration service keys * Revert newline changes in PCLCryptoFunctionService * Update KdfConfiguration.cs * Add checks for argon2, clean statemigration service * Update constants * Clean up code * Further cleanup * Change KdfType to non-nullable in SetKeyConnectorKeyRequest --------- Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
28 lines
787 B
C#
Executable File
28 lines
787 B
C#
Executable File
using Bit.Core;
|
|
using Bit.Core.Enums;
|
|
using Bit.Core.Models.Domain;
|
|
public struct KdfConfig
|
|
{
|
|
public static KdfConfig Default = new KdfConfig(KdfType.PBKDF2_SHA256, 5000, null, null);
|
|
public KdfConfig(KdfType? type, int? iterations, int? memory, int? parallelism)
|
|
{
|
|
Type = type;
|
|
Iterations = iterations;
|
|
Memory = memory;
|
|
Parallelism = parallelism;
|
|
}
|
|
|
|
public KdfConfig(Account.AccountProfile profile)
|
|
{
|
|
Type = profile.KdfType;
|
|
Iterations = profile.KdfIterations;
|
|
Memory = profile.KdfMemory;
|
|
Parallelism = profile.KdfParallelism;
|
|
}
|
|
|
|
public KdfType? Type { get; set; }
|
|
public int? Iterations { get; set; }
|
|
public int? Memory { get; set; }
|
|
public int? Parallelism { get; set; }
|
|
}
|