-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathBrainpoolP192.cs
More file actions
54 lines (48 loc) · 1.99 KB
/
BrainpoolP192.cs
File metadata and controls
54 lines (48 loc) · 1.99 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
53
54
using System.Globalization;
using System.Numerics;
namespace Waher.Security.EllipticCurves
{
/// <summary>
/// Brainpool P-192 Elliptic Curve, as defined in RFC5639:
/// https://datatracker.ietf.org/doc/html/rfc5639
/// </summary>
public class BrainpoolP192 : BrainpoolPrimeCurve
{
private static readonly BigInteger p0 = BigInteger.Parse("0C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", NumberStyles.HexNumber);
private static readonly BigInteger a = BigInteger.Parse("06A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF", NumberStyles.HexNumber);
private static readonly BigInteger b = BigInteger.Parse("0469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9", NumberStyles.HexNumber);
private static readonly BigInteger x = BigInteger.Parse("0C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6", NumberStyles.HexNumber);
private static readonly BigInteger y = BigInteger.Parse("014B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F", NumberStyles.HexNumber);
private static readonly BigInteger q = BigInteger.Parse("0C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", NumberStyles.HexNumber);
/// <summary>
/// Brainpool P-192 Elliptic Curve, as defined in RFC5639:
/// https://datatracker.ietf.org/doc/html/rfc5639
/// </summary>
public BrainpoolP192()
: base(p0, new PointOnCurve(x, y), a, b, q)
{
}
/// <summary>
/// Brainpool P-192 Elliptic Curve, as defined in RFC5639:
/// https://datatracker.ietf.org/doc/html/rfc5639
/// </summary>
/// <param name="Secret">Secret.</param>
public BrainpoolP192(byte[] Secret)
: base(p0, new PointOnCurve(x, y), a, b, q, Secret)
{
}
/// <summary>
/// Brainpool P-192 Elliptic Curve, as defined in RFC5639:
/// https://datatracker.ietf.org/doc/html/rfc5639
/// </summary>
/// <param name="Secret">Secret.</param>
public BrainpoolP192(uint[] Secret)
: base(p0, new PointOnCurve(x, y), a, b, q, Secret)
{
}
/// <summary>
/// Name of curve.
/// </summary>
public override string CurveName => "Brainpool P-192";
}
}