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;
2using System.Numerics;
3
5{
10 public class NistP256 : NistPrimeCurve
11 {
12 private static readonly BigInteger p0 = BigInteger.Pow(2, 256) - BigInteger.Pow(2, 224) + BigInteger.Pow(2, 192) + BigInteger.Pow(2, 96) - 1;
13 private static readonly BigInteger n0 = BigInteger.Parse("115792089210356248762697446949407573529996955224135760342422259061068512044369");
14 private static readonly BigInteger BasePointX = ToBigInteger(new uint[]
15 {
16 0x6b17d1f2, 0xe12c4247, 0xf8bce6e5, 0x63a440f2, 0x77037d81, 0x2deb33a0, 0xf4a13945, 0xd898c296
17 });
18 private static readonly BigInteger BasePointY = ToBigInteger(new uint[]
19 {
20 0x4fe342e2, 0xfe1a7f9b, 0x8ee7eb4a, 0x7c0f9e16, 0x2bce3357, 0x6b315ece, 0xcbb64068, 0x37bf51f5
21 });
22
27 public NistP256()
28 : base(p0, new PointOnCurve(BasePointX, BasePointY), n0)
29 {
30 }
31
37 public NistP256(byte[] Secret)
38 : base(p0, new PointOnCurve(BasePointX, BasePointY), n0, Secret)
39 {
40 }
41
45 public override string CurveName => "NIST P-256";
46 }
47}
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:11
NistP256(byte[] Secret)
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:37
override string CurveName
Name of curve.
Definition: NistP256.cs:45
NistP256()
NIST P-256 Elliptic Curve, as defined in NIST FIPS BUB 186-4: https://nvlpubs.nist....
Definition: NistP256.cs:27
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:11