Skip to content

Commit 4ac53da

Browse files
authored
Update ComputeHash in Argon2id tests and remove null check for Hash
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent e5972fa commit 4ac53da

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

HashifyNet.UnitTests/Algorithms/Argon2id/Argon2id_Implementation_Tests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public void Argon2id_Implementation_Verify_Works()
144144
IHashValue hash1 = impl.ComputeHash(TestConstants.FooBar);
145145

146146
Assert.NotNull(hash1);
147-
Assert.NotNull(hash1.Hash);
148147

149148
Assert.True(
150149
hash1.VerifyArgon2id(TestConstants.FooBar)
@@ -158,7 +157,6 @@ public void Argon2id_Implementation_Verify_Irrelevant_Fails()
158157
IHashValue hash1 = impl.ComputeHash(TestConstants.FooBar);
159158

160159
Assert.NotNull(hash1);
161-
Assert.NotNull(hash1.Hash);
162160

163161
Assert.False(
164162
hash1.VerifyArgon2id(TestConstants.LoremIpsum)
@@ -182,14 +180,12 @@ public class IHashFunction_Tests_DefaultConstructor
182180
protected override IHashValue ComputeHash(IArgon2id hf, byte[] data)
183181
{
184182
Argon2id_Implementation impl = hf as Argon2id_Implementation;
185-
IHashValue value = impl.ComputeHashWithSaltInternal(data, new byte[8]);
186-
byte[] actualHash = value.DecodeArgon2id();
187-
return new HashValue(actualHash, impl.Config.HashSizeInBits);
183+
return impl.ComputeHashWithSaltInternal(data, new byte[8]);
188184
}
189185

190186
protected override IArgon2id CreateHashFunction(int hashSize) =>
191187
new Argon2id_Implementation(
192188
Argon2idConfig.OWASP_Standard);
193189
}
194190
}
195-
}
191+
}

0 commit comments

Comments
 (0)