Skip to content

Commit c161712

Browse files
authored
Change Hash to AsByteArray()
Signed-off-by: Xen <lordofxen@deskasoft.com>
1 parent 08ee093 commit c161712

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

HashifyNet/Algorithms/Argon2id/IsopohImplementation/Argon2/Argon2.Blake2BLong.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private static void Blake2BLong(byte[] hash, byte[] inputBuffer, SecureArrayCall
5252
}
5353

5454
var hv = transformer.FinalizeHashValue();
55-
Array.Copy(hv.Hash, intermediateHash.Buffer, hv.Hash.Length);
55+
Array.Copy(hv.AsByteArray(), intermediateHash.Buffer, hv.Hash.Length);
5656
}
5757

5858
if (hash.Length <= intermediateHash.Buffer.Length)
@@ -73,7 +73,7 @@ private static void Blake2BLong(byte[] hash, byte[] inputBuffer, SecureArrayCall
7373
{
7474
Array.Copy(intermediateHash.Buffer, toHash.Buffer, intermediateHash.Buffer.Length); // set toHash to be the previous hash
7575
var hv = HashFactory<IBlake2B, IBlake2BConfig>.Create(blake2BConfig).ComputeHash(toHash.Buffer);
76-
Array.Copy(hv.Hash, intermediateHash.Buffer, hv.Hash.Length);
76+
Array.Copy(hv.AsByteArray(), intermediateHash.Buffer, hv.Hash.Length);
7777

7878
Array.Copy(intermediateHash.Buffer, 0, hash, pos, b2B2); // copy half hash result
7979
pos += b2B2;
@@ -92,7 +92,7 @@ private static void Blake2BLong(byte[] hash, byte[] inputBuffer, SecureArrayCall
9292

9393
{
9494
var hv = HashFactory<IBlake2B, IBlake2BConfig>.Create(blake2BConfig).ComputeHash(toHash.Buffer);
95-
Array.Copy(hv.Hash, intermediateHash.Buffer, hv.Hash.Length);
95+
Array.Copy(hv.AsByteArray(), intermediateHash.Buffer, hv.Hash.Length);
9696
}
9797
Array.Copy(intermediateHash.Buffer, 0, hash, pos, hash.Length - pos); // copy the final bytes from the first part of the hash result
9898
}
@@ -101,3 +101,4 @@ private static void Blake2BLong(byte[] hash, byte[] inputBuffer, SecureArrayCall
101101
}
102102

103103
}
104+

0 commit comments

Comments
 (0)