Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NistP256.cs
1using System.Numerics;
2
4{
9 public class NistP256 : NistPrimeCurve
10 {
11 private static readonly BigInteger p0 = BigInteger.Pow(2, 256) - BigInteger.Pow(2, 224) + BigInteger.Pow(2, 192) + BigInteger.Pow(2, 96) - 1;
12 private static readonly BigInteger n0 = BigInteger.Parse("115792089210356248762697446949407573529996955224135760342422259061068512044369");
13 private static readonly BigInteger B0 = ToBigInteger(new uint[]
14 {
15 0x5ac635d8, 0xaa3a93e7, 0xb3ebbd55, 0x769886bc, 0x651d06b0, 0xcc53b0f6,
16 0x3bce3c3e, 0x27d2604b
17 });
18 private static readonly BigInteger BasePointX = ToBigInteger(new uint[]
19 {
20 0x6b17d1f2, 0xe12c4247, 0xf8bce6e5, 0x63a440f2, 0x77037d81, 0x2deb33a0, 0xf4a13945, 0xd898c296
21 });
22 private static readonly BigInteger BasePointY = ToBigInteger(new uint[]
23 {
24 0x4fe342e2, 0xfe1a7f9b, 0x8ee7eb4a, 0x7c0f9e16, 0x2bce3357, 0x6b315ece, 0xcbb64068, 0x37bf51f5
25 });
26
31 public NistP256()
32 : base(p0, new PointOnCurve(BasePointX, BasePointY), B0, n0)
33 {
34 }
35
41 public NistP256(byte[] Secret)
42 : base(p0, new PointOnCurve(BasePointX, BasePointY), B0, n0, Secret)
43 {
44 }
45
49 public override string CurveName => "NIST P-256";
50 }
51}
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:10
NistP256(byte[] Secret)
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:41
override string CurveName
Name of curve.
Definition: NistP256.cs:49
NistP256()
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:31
Base class of Elliptic curves over a prime field defined by NIST.
static BigInteger ToBigInteger(uint[] BigEndianDWords)
Converts a sequence of unsigned 32-bit integers to a BigInteger.
Represents a point on a curve.
Definition: PointOnCurve.cs:10