Add project
Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
42
Hcs.Client/GostCryptography/Base/GostHashAlgorithm.cs
Normal file
42
Hcs.Client/GostCryptography/Base/GostHashAlgorithm.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using GostCryptography.Config;
|
||||
using System.Security;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace GostCryptography.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Базовый класс для всех алгоритмов хэширования ГОСТ
|
||||
/// </summary>
|
||||
public abstract class GostHashAlgorithm : HashAlgorithm, IGostAlgorithm
|
||||
{
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
/// </summary>
|
||||
/// <param name="hashSize">Размер хэш-кода в битах</param>
|
||||
/// <remarks>
|
||||
/// По умолчанию использует криптографический провайдер, установленный в <see cref="GostCryptoConfig.ProviderType"/>
|
||||
/// </remarks>
|
||||
[SecuritySafeCritical]
|
||||
protected GostHashAlgorithm(int hashSize) : this(GostCryptoConfig.ProviderType, hashSize)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
/// </summary>
|
||||
/// <param name="providerType">Тип криптографического провайдера</param>
|
||||
/// <param name="hashSize">Размер хэш-кода в битах</param>
|
||||
[SecuritySafeCritical]
|
||||
protected GostHashAlgorithm(ProviderType providerType, int hashSize)
|
||||
{
|
||||
ProviderType = providerType;
|
||||
HashSizeValue = hashSize;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ProviderType ProviderType { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public abstract string AlgorithmName { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user