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

@@ -0,0 +1,26 @@
using System;
using Org.BouncyCastle.Crypto;
namespace ModernKeePassLib.Cryptography.Hash
{
public abstract class DigestManaged : IDisposable
{
protected IDigest _hash;
public byte[] ComputeHash(byte[] value, int offset, int length)
{
if (value == null) throw new ArgumentNullException(nameof(value));
byte[] resBuf = new byte[_hash.GetDigestSize()];
_hash.BlockUpdate(value, offset, length);
_hash.DoFinal(resBuf, 0);
return resBuf;
}
public void Dispose()
{
_hash.Reset();
}
}
}