Add project

Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
This commit is contained in:
2025-08-12 11:21:10 +09:00
parent bbcbe841a7
commit 33ab055b43
546 changed files with 176950 additions and 0 deletions

View 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; }
}
}