/// <inheritsdoc /> public override bool Verify(ReadOnlySpan <byte> input, ReadOnlySpan <byte> signature) { Debug.Assert(!_disposed); Span <byte> hash = stackalloc byte[_hashSizeInBytes]; _hashAlgorithm.ComputeHash(input, hash); return(CryptographicOperations.FixedTimeEquals(signature, hash)); }
/// <inheritsdoc /> public override bool TrySign(ReadOnlySpan <byte> input, Span <byte> destination, out int bytesWritten) { Debug.Assert(!_disposed); _hashAlgorithm.ComputeHash(input, destination); bytesWritten = destination.Length; return(true); }