Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Weichhold committed Oct 18, 2018
1 parent 4844262 commit 55ac092
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/Miningcore/Crypto/Hashing/Algorithms/Lyra2Rev2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ public void Digest(ReadOnlySpan<byte> data, Span<byte> result, params object[] e
Contract.Requires<ArgumentException>(data.Length == 80, $"{nameof(data)} must be exactly 80 bytes long");
Contract.Requires<ArgumentException>(result.Length >= 32, $"{nameof(result)} must be greater or equal 32 bytes");

var o = new byte[32];

fixed (byte* input = data)
{
fixed (byte* output = result)
fixed (byte* output = o)
{
LibMultihash.lyra2rev2(input, output);
}
}

o.CopyTo(result);
}
}
}
6 changes: 5 additions & 1 deletion src/Miningcore/Crypto/Hashing/Algorithms/X11.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ public void Digest(ReadOnlySpan<byte> data, Span<byte> result, params object[] e
{
Contract.Requires<ArgumentException>(result.Length >= 32, $"{nameof(result)} must be greater or equal 32 bytes");

var o = new byte[32];

fixed (byte* input = data)
{
fixed (byte* output = result)
fixed (byte* output = o)
{
LibMultihash.x11(input, output, (uint) data.Length);
}
}

o.CopyTo(result);
}
}
}

0 comments on commit 55ac092

Please sign in to comment.