Exemplo n.º 1
0
 public PheCrypto()
 {
     this.curveParams = NistNamedCurves.GetByName("P-256");
     this.Curve       = (FpCurve)this.curveParams.Curve;
     this.CurveG      = this.curveParams.G.Multiply(BigInteger.ValueOf(1));
     this.Rng         = new PheRandomGenerator();
     this.sha512      = new SHA512Helper();
     this.swu         = new Swu(this.Curve.Q, this.Curve.B.ToBigInteger());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Swu"/> class.
 /// </summary>
 public Swu(BigInteger p, BigInteger b)
 {
     this.p      = p;
     this.b      = b;
     this.a      = p.Neg(BigInteger.Three);
     this.mba    = p.Neg(p.Div(this.b, this.a));
     this.p34    = p.Div(this.a, BigInteger.ValueOf(4));
     this.p14    = p.Div(p.Add(p, BigInteger.One), BigInteger.ValueOf(4));
     this.sha512 = new SHA512Helper();
 }