mirrored from https://www.bouncycastle.org/repositories/bc-csharp
-
Notifications
You must be signed in to change notification settings - Fork 602
Expand file tree
/
Copy pathPrfAlgorithm.cs
More file actions
52 lines (49 loc) · 1.69 KB
/
Copy pathPrfAlgorithm.cs
File metadata and controls
52 lines (49 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
namespace Org.BouncyCastle.Tls
{
/// <summary>RFC 5246</summary>
/// <remarks>
/// Note that the values here are implementation-specific and arbitrary. It is recommended not to depend on the
/// particular values (e.g. serialization).
/// </remarks>
public abstract class PrfAlgorithm
{
public const int ssl_prf_legacy = 0;
public const int tls_prf_legacy = 1;
public const int tls_prf_sha256 = 2;
public const int tls_prf_sha384 = 3;
public const int tls13_hkdf_sha256 = 4;
public const int tls13_hkdf_sha384 = 5;
//public const int tls13_hkdf_sha512 = 6;
public const int tls13_hkdf_sm3 = 7;
public const int tls_prf_gostr3411_2012_256 = 8;
public static string GetName(int prfAlgorithm)
{
switch (prfAlgorithm)
{
case ssl_prf_legacy:
return "ssl_prf_legacy";
case tls_prf_legacy:
return "tls_prf_legacy";
case tls_prf_sha256:
return "tls_prf_sha256";
case tls_prf_sha384:
return "tls_prf_sha384";
case tls13_hkdf_sha256:
return "tls13_hkdf_sha256";
case tls13_hkdf_sha384:
return "tls13_hkdf_sha384";
case tls13_hkdf_sm3:
return "tls13_hkdf_sm3";
case tls_prf_gostr3411_2012_256:
return "tls_prf_gostr3411_2012_256";
default:
return "UNKNOWN";
}
}
public static string GetText(int prfAlgorithm)
{
return GetName(prfAlgorithm) + "(" + prfAlgorithm + ")";
}
}
}