示例#1
0
        public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y)
        {
            ulong[] ax = this.x;
            ulong[] xx = ((SecT409FieldElement)x).x, yx = ((SecT409FieldElement)y).x;

            ulong[] tt = Nat.Create64(13);
            SecT409Field.SquareAddToExt(ax, tt);
            SecT409Field.MultiplyAddToExt(xx, yx, tt);

            ulong[] z = Nat448.Create64();
            SecT409Field.Reduce(tt, z);
            return(new SecT409FieldElement(z));
        }
示例#2
0
 public override ECFieldElement Multiply(ECFieldElement b)
 {
     ulong[] z = Nat448.Create64();
     SecT409Field.Multiply(x, ((SecT409FieldElement)b).x, z);
     return(new SecT409FieldElement(z));
 }
示例#3
0
 public override ECFieldElement AddOne()
 {
     ulong[] z = Nat448.Create64();
     SecT409Field.AddOne(x, z);
     return(new SecT409FieldElement(z));
 }
 public override ECFieldElement Invert()
 {
     ulong[] z = Nat448.Create64();
     SecT409Field.Invert(this.x, z);
     return(new SecT409FieldElement(z));
 }
 public override ECFieldElement Add(ECFieldElement b)
 {
     ulong[] z = Nat448.Create64();
     SecT409Field.Add(this.x, ((SecT409FieldElement)b).x, z);
     return(new SecT409FieldElement(z));
 }
示例#6
0
 public static void MultiplyAddToExt(ulong[] x, ulong[] y, ulong[] zz)
 {
     ulong[] array = Nat448.CreateExt64();
     SecT409Field.ImplMultiply(x, y, array);
     SecT409Field.AddExt(zz, array, zz);
 }
示例#7
0
 public static void Multiply(ulong[] x, ulong[] y, ulong[] z)
 {
     ulong[] array = Nat448.CreateExt64();
     SecT409Field.ImplMultiply(x, y, array);
     SecT409Field.Reduce(array, z);
 }
示例#8
0
 public static ulong[] FromBigInteger(BigInteger x)
 {
     ulong[] array = Nat448.FromBigInteger64(x);
     SecT409Field.Reduce39(array, 0);
     return(array);
 }
示例#9
0
 public static void SquareAddToExt(ulong[] x, ulong[] zz)
 {
     ulong[] array = Nat.Create64(13);
     SecT409Field.ImplSquare(x, array);
     SecT409Field.AddExt(zz, array, zz);
 }
示例#10
0
 public static void Square(ulong[] x, ulong[] z)
 {
     ulong[] array = Nat.Create64(13);
     SecT409Field.ImplSquare(x, array);
     SecT409Field.Reduce(array, z);
 }
示例#11
0
 public override int Trace()
 {
     return((int)SecT409Field.Trace(x));
 }