using GostCryptography.Base;
using GostCryptography.Native;
using System.Security;
namespace GostCryptography.Gost_R3411
{
///
/// Реализация алгоритма хэширования ГОСТ Р 34.11-94
///
public sealed class Gost_R3411_94_HashAlgorithm : Gost_R3411_HashAlgorithm
{
///
/// Размер хэша ГОСТ Р 34.11-94
///
public const int DefaultHashSizeValue = 256;
///
/// Наименование алгоритма хэширования ГОСТ Р 34.11-94
///
public const string AlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411";
///
/// Устаревшее наименование алгоритма хэширования ГОСТ Р 34.11-94
///
public const string ObsoleteAlgorithmNameValue = "http://www.w3.org/2001/04/xmldsig-more#gostr3411";
///
/// Известные наименования алгоритма хэширования ГОСТ Р 34.11-94
///
public static readonly string[] KnownAlgorithmNames = { AlgorithmNameValue, ObsoleteAlgorithmNameValue };
///
[SecuritySafeCritical]
public Gost_R3411_94_HashAlgorithm() : base(DefaultHashSizeValue)
{
}
///
[SecuritySafeCritical]
public Gost_R3411_94_HashAlgorithm(ProviderType providerType) : base(providerType, DefaultHashSizeValue)
{
}
[SecurityCritical]
internal Gost_R3411_94_HashAlgorithm(ProviderType providerType, SafeProvHandleImpl providerHandle) : base(providerType, providerHandle, DefaultHashSizeValue)
{
}
///
public override string AlgorithmName => AlgorithmNameValue;
///
[SecurityCritical]
protected override SafeHashHandleImpl CreateHashHandle(SafeProvHandleImpl providerHandle)
{
return CryptoApiHelper.CreateHash_3411_94(providerHandle);
}
}
}