diff --git a/src/Cryptography/Argon2Parameters.cs b/src/Cryptography/Argon2Parameters.cs index 9de21294..febf3526 100644 --- a/src/Cryptography/Argon2Parameters.cs +++ b/src/Cryptography/Argon2Parameters.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; namespace NSec.Cryptography @@ -8,5 +9,8 @@ public struct Argon2Parameters public int DegreeOfParallelism; public long MemorySize; public long NumberOfPasses; + + [SuppressMessage("Performance", "CA1822")] + public readonly int Version => 0x13; // copied from libsodium/crypto_pwhash/argon2/argon2-core.h } } diff --git a/tests/Algorithms/Argon2iTests.cs b/tests/Algorithms/Argon2iTests.cs index d99198bc..7adac324 100644 --- a/tests/Algorithms/Argon2iTests.cs +++ b/tests/Algorithms/Argon2iTests.cs @@ -21,6 +21,7 @@ public static void Properties() Assert.Equal(16, a.MinSaltSize); Assert.Equal(int.MaxValue, a.MaxCount); + Assert.Equal(19, actual.Version); Assert.Equal(expected.DegreeOfParallelism, actual.DegreeOfParallelism); Assert.Equal(expected.MemorySize, actual.MemorySize); Assert.Equal(expected.NumberOfPasses, actual.NumberOfPasses); diff --git a/tests/Algorithms/Argon2idTests.cs b/tests/Algorithms/Argon2idTests.cs index 58b0282e..a88c8cba 100644 --- a/tests/Algorithms/Argon2idTests.cs +++ b/tests/Algorithms/Argon2idTests.cs @@ -20,6 +20,7 @@ public static void Properties() Assert.Equal(16, a.MinSaltSize); Assert.Equal(int.MaxValue, a.MaxCount); + Assert.Equal(19, actual.Version); Assert.Equal(expected.DegreeOfParallelism, actual.DegreeOfParallelism); Assert.Equal(expected.MemorySize, actual.MemorySize); Assert.Equal(expected.NumberOfPasses, actual.NumberOfPasses);