Files
hcs/Hcs.Client/GostCryptography/Gost_R3411/Gost_R3411_2012_256_PRF.cs
HOME-LAPTOP\kshkulev 33ab055b43 Add project
Basic formatting applied. Unnecessary comments have been removed. Suspicious code is covered by TODO.
2025-08-12 11:21:10 +09:00

51 lines
2.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Security;
using GostCryptography.Base;
using GostCryptography.Gost_28147_89;
namespace GostCryptography.Gost_R3411
{
/// <summary>
/// Реализация PRF на базе алгоритма хэширования ГОСТ Р 34.11-2012/256
/// </summary>
public sealed class Gost_R3411_2012_256_PRF : Gost_R3411_PRF<Gost_R3411_2012_256_HMAC>
{
/// <summary>
/// Наименование алгоритма PRF на базе ГОСТ Р 34.11-2012/256 для использования в протоколе WS-Trust
/// </summary>
public const string WsTrustAlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:ck-p-gostr3411-2012-256";
/// <summary>
/// Наименование алгоритма PRF на базе ГОСТ Р 34.11-2012/256 для использования в протоколах на базе WS-SecureConversation
/// </summary>
public const string WsSecureConversationAlgorithmNameValue = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:dk-p-gostr3411-2012-256";
/// <summary>
/// Известные наименования алгоритма PRF на базе ГОСТ Р 34.11-2012/256
/// </summary>
public static readonly string[] KnownAlgorithmNames = { WsTrustAlgorithmNameValue, WsSecureConversationAlgorithmNameValue };
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_256_PRF(Gost_28147_89_SymmetricAlgorithmBase key, byte[] label, byte[] seed) : base(key, label, seed)
{
}
/// <inheritdoc />
[SecuritySafeCritical]
public Gost_R3411_2012_256_PRF(ProviderType providerType, byte[] key, byte[] label, byte[] seed) : base(providerType, key, label, seed)
{
}
/// <inheritdoc />
public override string AlgorithmName => WsTrustAlgorithmNameValue;
/// <inheritdoc />
[SecuritySafeCritical]
protected override Gost_R3411_2012_256_HMAC CreateHMAC(Gost_28147_89_SymmetricAlgorithm key)
{
return new Gost_R3411_2012_256_HMAC(key);
}
}
}