From c4d65f3c2a64d9f4b629fb82f843d5da54a488c6 Mon Sep 17 00:00:00 2001 From: Ronald Lonnborg Jr Date: Sun, 8 Sep 2024 11:28:57 -0500 Subject: [PATCH] Update Kezzak.cs --- .../Crypto/Hashing/Algorithms/Kezzak.cs | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/Miningcore/Crypto/Hashing/Algorithms/Kezzak.cs b/src/Miningcore/Crypto/Hashing/Algorithms/Kezzak.cs index 51fd40398..91ec441bd 100644 --- a/src/Miningcore/Crypto/Hashing/Algorithms/Kezzak.cs +++ b/src/Miningcore/Crypto/Hashing/Algorithms/Kezzak.cs @@ -1,36 +1,20 @@ using Miningcore.Contracts; -using Miningcore.Extensions; using Miningcore.Native; namespace Miningcore.Crypto.Hashing.Algorithms; [Identifier("groestl-myriad")] -public unsafe class Kezzak : IHashAlgorithm +public unsafe class GroestlMyriad : IHashAlgorithm { public void Digest(ReadOnlySpan data, Span result, params object[] extra) { - Contract.RequiresNonNull(extra); - Contract.Requires(extra.Length > 0); Contract.Requires(result.Length >= 32); - // concat nTime as hex string to data - var nTime = (ulong) extra[0]; - var nTimeHex = nTime.ToString("X").HexToByteArray(); - - Span dataEx = stackalloc byte[data.Length + nTimeHex.Length]; - data.CopyTo(dataEx); - - if(nTimeHex.Length > 0) - { - var dest = dataEx[data.Length..]; - nTimeHex.CopyTo(dest); - } - - fixed (byte* input = dataEx) + fixed (byte* input = data) { fixed (byte* output = result) { - Multihash.kezzak(input, output, (uint) data.Length); + Multihash.groestl_myriad(input, output, (uint) data.Length); } } }