Skip to content

Commit 529a31b

Browse files
authored
Update DegreeOfParallelism check for argon2id implementation
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 770db6f commit 529a31b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

HashifyNet/Algorithms/Argon2id/Argon2id_Implementation.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ public Argon2id_Implementation(IArgon2idConfig config)
6969
throw new ArgumentOutOfRangeException($"{nameof(config)}.{nameof(config.Iterations)}", config.Iterations, "Iterations must be at least 1.");
7070
}
7171

72-
int maxProcessors = Math.Max(1, Environment.ProcessorCount);
73-
if (_config.DegreeOfParallelism < 1 || _config.DegreeOfParallelism > maxProcessors)
72+
if (_config.DegreeOfParallelism < 1)
7473
{
75-
throw new ArgumentOutOfRangeException($"{nameof(config)}.{nameof(config.DegreeOfParallelism)}", config.DegreeOfParallelism, $"Degree of parallelism must be at least 1 and smaller or equal to processor count '{maxProcessors}'.");
74+
throw new ArgumentOutOfRangeException($"{nameof(config)}.{nameof(config.DegreeOfParallelism)}", config.DegreeOfParallelism, $"Degree of parallelism must be at least 1.");
7675
}
7776

7877
if (_config.MemorySize < 8 * _config.DegreeOfParallelism)

0 commit comments

Comments
 (0)