Bugfix: Stream's position was not reset

This commit is contained in:
Thorsten Sommer 2020-01-03 21:47:11 +01:00
parent 69acb7ae71
commit 4f62c65f2d

View File

@ -17,6 +17,8 @@ namespace Ed25519
internal static ReadOnlySpan<byte> ComputeHash(this Stream inputStream)
{
inputStream.Seek(0, SeekOrigin.Begin);
using var sha512 = SHA512.Create();
return sha512.ComputeHash(inputStream);
}
@ -84,6 +86,8 @@ namespace Ed25519
internal static BigInteger HashInt(this MemoryStream data)
{
data.Seek(0, SeekOrigin.Begin);
var hash = data.ComputeHash();
var hashSum = BigInteger.Zero;