forked from oliverw/miningcore
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
259f37f
commit 15b7f2b
Showing
26 changed files
with
23,588 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Miningcore.Contracts; | ||
using Miningcore.Native; | ||
|
||
namespace Miningcore.Crypto.Hashing.Algorithms; | ||
|
||
[Identifier("blake3")] | ||
public unsafe class Blake3 : IHashAlgorithm | ||
{ | ||
public void Digest(ReadOnlySpan<byte> data, Span<byte> result, params object[] extra) | ||
{ | ||
Contract.Requires<ArgumentException>(result.Length >= 32); | ||
|
||
fixed (byte* input = data) | ||
{ | ||
fixed (byte* output = result) | ||
{ | ||
Multihash.blake3(input, output, (uint) data.Length); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.