예제 #1
0
        public override bool Verify(ReadOnlySpan <byte> header, ReadOnlySpan <byte> solution)
        {
            var sw = Stopwatch.StartNew();

            try
            {
                sem.Value.WaitOne();

                fixed(byte *h = header)
                {
                    fixed(byte *s = solution)
                    {
                        var result = LibMultihash.equihash_verify_96_5(h, header.Length, s, solution.Length, personalization);

                        messageBus?.SendTelemetry("Equihash 96-5", TelemetryCategory.Hash, sw.Elapsed, result);

                        return(result);
                    }
                }
            }

            finally
            {
                sem.Value.Release();
            }
        }
예제 #2
0
        public override bool Verify(ReadOnlySpan <byte> header, ReadOnlySpan <byte> solution)
        {
            try
            {
                sem.Value.WaitOne();

                fixed(byte *h = header)
                {
                    fixed(byte *s = solution)
                    {
                        return(LibMultihash.equihash_verify_96_5(h, header.Length, s, solution.Length, personalization));
                    }
                }
            }
            finally
            {
                sem.Value.Release();
            }
        }