Correct implementation of SHA512 with WinRT in KeepassLib

This commit is contained in:
2017-10-23 10:29:07 +02:00
committed by BONNEVILLE Geoffroy
parent e95e62f184
commit a11d209280
15 changed files with 101 additions and 120 deletions

View File

@@ -270,11 +270,15 @@ namespace ModernKeePassLib.Cryptography.Hash
Reset();
}
internal byte[] ComputeHash(byte[] pbOutBuffer)
internal byte[] ComputeHash(byte[] value)
{
byte[] result = new byte[pbOutBuffer.Length];
DoFinal(result, 0);
return result;
if (value == null) throw new ArgumentNullException(nameof(value));
byte[] resBuf = new byte[m_cbHashLength];
BlockUpdate(value, 0, value.Length);
DoFinal(resBuf, 0);
return resBuf;
}
}
}