Esempio n. 1
0
        public unsafe bool Compute(byte[] hash, ulong nonce, out byte[] mixDigest, out byte[] result)
        {
            Contract.RequiresNonNull(hash, nameof(hash));

            mixDigest = null;
            result    = null;

            var value = new LibMultihash.ethash_return_value();

            fixed(byte *input = hash)
            {
                LibMultihash.ethash_full_compute(handle, input, nonce, ref value);
            }

            if (value.success)
            {
                mixDigest = value.mix_hash.value;
                result    = value.result.value;
            }

            return(value.success);
        }