Skip to content

Commit b68542e

Browse files
authored
Replace the internal sha512 implementation with .Net built in sha512 (#390)
* Replace the internal sha512 implementation with .Net built in sha512 * Add IDisposable to Sha512 wrapper --------- Co-authored-by: Niklas Petersen <niklasfp@users.noreply.github.com>
1 parent 7d74070 commit b68542e

File tree

7 files changed

+17
-674
lines changed

7 files changed

+17
-674
lines changed

src/NATS.Client.Core/NaCl/Internal/Array16.cs

-27
This file was deleted.

src/NATS.Client.Core/NaCl/Internal/Array8.cs

-18
This file was deleted.

src/NATS.Client.Core/NaCl/Internal/ByteIntegerConverter.cs

-55
This file was deleted.

src/NATS.Client.Core/NaCl/Internal/Ed25519Ref10/open.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static bool crypto_sign_verify(
7474
if (GroupOperations.ge_frombytes_negate_vartime(out A, pk, pkoffset) != 0)
7575
return false;
7676

77-
var hasher = new Sha512();
77+
using var hasher = new Sha512();
7878
hasher.Update(sig, sigoffset, 32);
7979
hasher.Update(pk, pkoffset, 32);
8080
hasher.Update(m, moffset, mlen);

src/NATS.Client.Core/NaCl/Internal/Ed25519Ref10/sign.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static void crypto_sign(
2626
{
2727
byte[] az, r, hram;
2828
GroupElementP3 R;
29-
var hasher = new Sha512();
29+
using var hasher = new Sha512();
3030
{
3131
hasher.Update(sk, skoffset, 32);
3232
az = hasher.Finalize();

0 commit comments

Comments
 (0)