WIP 2.37 - ter

This commit is contained in:
bg45
2017-10-22 16:44:17 -04:00
committed by BONNEVILLE Geoffroy
parent 84e7afc819
commit e95e62f184
8 changed files with 134 additions and 54 deletions

View File

@@ -52,15 +52,15 @@ namespace ModernKeePassLib.Cryptography
byte[] pbHash;
#if ModernKeePassLib
/*#if ModernKeePassLib
var h = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Sha256).CreateHash();
CryptographicBuffer.CopyToByteArray(h.GetValueAndReset(), out pbHash);
#else
#else*/
using(SHA256Managed h = new SHA256Managed())
{
pbHash = h.ComputeHash(pbData, iOffset, cbCount);
}
#endif
//#endif
#if DEBUG
// Ensure the data has not been modified
@@ -90,15 +90,15 @@ namespace ModernKeePassLib.Cryptography
if(cbOut <= 32) pbHash = HashSha256(pbIn, iInOffset, cbIn);
else
{
#if ModernKeePassLib
/*#if ModernKeePassLib
var h = HashAlgorithmProvider.OpenAlgorithm(HashAlgorithmNames.Sha512).CreateHash();
CryptographicBuffer.CopyToByteArray(h.GetValueAndReset(), out pbHash);
#else
#else*/
using(SHA512Managed h = new SHA512Managed())
{
pbHash = h.ComputeHash(pbIn, iInOffset, cbIn);
}
#endif
//#endif
}
if(cbOut == pbHash.Length) return pbHash;