Bugfix: Stream's position was not reset
This commit is contained in:
parent
69acb7ae71
commit
4f62c65f2d
@ -17,6 +17,8 @@ namespace Ed25519
|
|||||||
|
|
||||||
internal static ReadOnlySpan<byte> ComputeHash(this Stream inputStream)
|
internal static ReadOnlySpan<byte> ComputeHash(this Stream inputStream)
|
||||||
{
|
{
|
||||||
|
inputStream.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
using var sha512 = SHA512.Create();
|
using var sha512 = SHA512.Create();
|
||||||
return sha512.ComputeHash(inputStream);
|
return sha512.ComputeHash(inputStream);
|
||||||
}
|
}
|
||||||
@ -84,6 +86,8 @@ namespace Ed25519
|
|||||||
|
|
||||||
internal static BigInteger HashInt(this MemoryStream data)
|
internal static BigInteger HashInt(this MemoryStream data)
|
||||||
{
|
{
|
||||||
|
data.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
var hash = data.ComputeHash();
|
var hash = data.ComputeHash();
|
||||||
var hashSum = BigInteger.Zero;
|
var hashSum = BigInteger.Zero;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user