Beispiel #1
0
        public void Digest(ReadOnlySpan <byte> data, Span <byte> result, params object[] extra)
        {
            Contract.Requires <ArgumentException>(result.Length >= 64, $"{nameof(result)} must be greater or equal 32 bytes");

            fixed(byte *input = data)
            {
                fixed(byte *output = result)
                {
                    LibMultihash.sha3_512(input, output, (uint)data.Length);
                }
            }
        }
Beispiel #2
0
        public byte[] Digest(byte[] data, params object[] extra)
        {
            Contract.RequiresNonNull(data, nameof(data));

            var result = new byte[64];

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

            return(result);
        }