/*
		r = p
		*/
		public static void ge_p1p1_to_p3(out GroupElementP3 r, ref  GroupElementP1P1 p)
		{
			FieldOperations.fe_mul(out r.X, ref p.X, ref p.T);
			FieldOperations.fe_mul(out r.Y, ref p.Y, ref p.Z);
			FieldOperations.fe_mul(out r.Z, ref p.Z, ref p.T);
			FieldOperations.fe_mul(out r.T, ref p.X, ref p.Y);
		}
Exemple #2
0
        /*
         * r = 2 * p
         */
        public static void ge_p3_dbl(out GroupElementP1P1 r, ref GroupElementP3 p)
        {
            GroupElementP2 q;

            ge_p3_to_p2(out q, ref p);
            ge_p2_dbl(out r, ref q);
        }
Exemple #3
0
 /*
  * r = p
  */
 public static void ge_p1p1_to_p3(out GroupElementP3 r, ref GroupElementP1P1 p)
 {
     FieldOperations.fe_mul(out r.X, ref p.X, ref p.T);
     FieldOperations.fe_mul(out r.Y, ref p.Y, ref p.Z);
     FieldOperations.fe_mul(out r.Z, ref p.Z, ref p.T);
     FieldOperations.fe_mul(out r.T, ref p.X, ref p.Y);
 }
Exemple #4
0
		/*
		r = p - q
		*/
		public static void ge_msub(out GroupElementP1P1 r, ref  GroupElementP3 p, ref  GroupElementPreComp q)
		{
			FieldElement t0;

			/* qhasm: YpX1 = Y1+X1 */
			/* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
			/* asm 2: fe_add(>YpX1=r.X,<Y1=p.Y,<X1=p.X); */
			FieldOperations.fe_add(out r.X, ref p.Y, ref p.X);

			/* qhasm: YmX1 = Y1-X1 */
			/* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
			/* asm 2: fe_sub(>YmX1=r.Y,<Y1=p.Y,<X1=p.X); */
			FieldOperations.fe_sub(out r.Y, ref p.Y, ref p.X);

			/* qhasm: A = YpX1*ymx2 */
			/* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<ymx2=fe#16); */
			/* asm 2: fe_mul(>A=r.Z,<YpX1=r.X,<ymx2=q.yminusx); */
			FieldOperations.fe_mul(out r.Z, ref r.X, ref q.yminusx);

			/* qhasm: B = YmX1*ypx2 */
			/* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<ypx2=fe#15); */
			/* asm 2: fe_mul(>B=r.Y,<YmX1=r.Y,<ypx2=q.yplusx); */
			FieldOperations.fe_mul(out r.Y, ref r.Y, ref q.yplusx);

			/* qhasm: C = xy2d2*T1 */
			/* asm 1: fe_mul(>C=fe#4,<xy2d2=fe#17,<T1=fe#14); */
			/* asm 2: fe_mul(>C=r.T,<xy2d2=q.xy2d,<T1=p.T); */
			FieldOperations.fe_mul(out r.T, ref q.xy2d, ref p.T);

			/* qhasm: D = 2*Z1 */
			/* asm 1: fe_add(>D=fe#5,<Z1=fe#13,<Z1=fe#13); */
			/* asm 2: fe_add(>D=t0,<Z1=p.Z,<Z1=p.Z); */
			FieldOperations.fe_add(out t0, ref p.Z, ref p.Z);

			/* qhasm: X3 = A-B */
			/* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
			/* asm 2: fe_sub(>X3=r.X,<A=r.Z,<B=r.Y); */
			FieldOperations.fe_sub(out r.X, ref r.Z, ref r.Y);

			/* qhasm: Y3 = A+B */
			/* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
			/* asm 2: fe_add(>Y3=r.Y,<A=r.Z,<B=r.Y); */
			FieldOperations.fe_add(out r.Y, ref r.Z, ref r.Y);

			/* qhasm: Z3 = D-C */
			/* asm 1: fe_sub(>Z3=fe#3,<D=fe#5,<C=fe#4); */
			/* asm 2: fe_sub(>Z3=r.Z,<D=t0,<C=r.T); */
			FieldOperations.fe_sub(out r.Z, ref t0, ref r.T);

			/* qhasm: T3 = D+C */
			/* asm 1: fe_add(>T3=fe#4,<D=fe#5,<C=fe#4); */
			/* asm 2: fe_add(>T3=r.T,<D=t0,<C=r.T); */
			FieldOperations.fe_add(out r.T, ref t0, ref r.T);

			/* qhasm: return */

		}
        /*
         * r = p + q
         */
        public static void ge_madd(out GroupElementP1P1 r, ref GroupElementP3 p, ref GroupElementPreComp q)
        {
            FieldElement t0;

            /* qhasm: YpX1 = Y1+X1 */
            /* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
            /* asm 2: fe_add(>YpX1=r.X,<Y1=p.Y,<X1=p.X); */
            FieldOperations.fe_add(out r.X, ref p.Y, ref p.X);

            /* qhasm: YmX1 = Y1-X1 */
            /* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
            /* asm 2: fe_sub(>YmX1=r.Y,<Y1=p.Y,<X1=p.X); */
            FieldOperations.fe_sub(out r.Y, ref p.Y, ref p.X);

            /* qhasm: A = YpX1*ypx2 */
            /* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<ypx2=fe#15); */
            /* asm 2: fe_mul(>A=r.Z,<YpX1=r.X,<ypx2=q.yplusx); */
            FieldOperations.fe_mul(out r.Z, ref r.X, ref q.yplusx);

            /* qhasm: B = YmX1*ymx2 */
            /* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<ymx2=fe#16); */
            /* asm 2: fe_mul(>B=r.Y,<YmX1=r.Y,<ymx2=q.yminusx); */
            FieldOperations.fe_mul(out r.Y, ref r.Y, ref q.yminusx);

            /* qhasm: C = xy2d2*T1 */
            /* asm 1: fe_mul(>C=fe#4,<xy2d2=fe#17,<T1=fe#14); */
            /* asm 2: fe_mul(>C=r.T,<xy2d2=q.xy2d,<T1=p.T); */
            FieldOperations.fe_mul(out r.T, ref q.xy2d, ref p.T);

            /* qhasm: D = 2*Z1 */
            /* asm 1: fe_add(>D=fe#5,<Z1=fe#13,<Z1=fe#13); */
            /* asm 2: fe_add(>D=t0,<Z1=p.Z,<Z1=p.Z); */
            FieldOperations.fe_add(out t0, ref p.Z, ref p.Z);

            /* qhasm: X3 = A-B */
            /* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
            /* asm 2: fe_sub(>X3=r.X,<A=r.Z,<B=r.Y); */
            FieldOperations.fe_sub(out r.X, ref r.Z, ref r.Y);

            /* qhasm: Y3 = A+B */
            /* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
            /* asm 2: fe_add(>Y3=r.Y,<A=r.Z,<B=r.Y); */
            FieldOperations.fe_add(out r.Y, ref r.Z, ref r.Y);

            /* qhasm: Z3 = D+C */
            /* asm 1: fe_add(>Z3=fe#3,<D=fe#5,<C=fe#4); */
            /* asm 2: fe_add(>Z3=r.Z,<D=t0,<C=r.T); */
            FieldOperations.fe_add(out r.Z, ref t0, ref r.T);

            /* qhasm: T3 = D-C */
            /* asm 1: fe_sub(>T3=fe#4,<D=fe#5,<C=fe#4); */
            /* asm 2: fe_sub(>T3=r.T,<D=t0,<C=r.T); */
            FieldOperations.fe_sub(out r.T, ref t0, ref r.T);

            /* qhasm: return */
        }
Exemple #6
0
        public static void ge_mul8(out GroupElementP1P1 r, ref GroupElementP2 t)
        {
            GroupElementP2 u;

            ge_p2_dbl(out r, ref t);
            ge_p1p1_to_p2(out u, ref r);
            ge_p2_dbl(out r, ref u);
            ge_p1p1_to_p2(out u, ref r);
            ge_p2_dbl(out r, ref u);
        }
Exemple #7
0
		/*
		r = 2 * p
		*/

		public static void ge_p2_dbl(out GroupElementP1P1 r, ref GroupElementP2 p)
		{
			FieldElement t0;

			/* qhasm: XX=X1^2 */
			/* asm 1: fe_sq(>XX=fe#1,<X1=fe#11); */
			/* asm 2: fe_sq(>XX=r.X,<X1=p.X); */
			FieldOperations.fe_sq(out r.X, ref p.X);

			/* qhasm: YY=Y1^2 */
			/* asm 1: fe_sq(>YY=fe#3,<Y1=fe#12); */
			/* asm 2: fe_sq(>YY=r.Z,<Y1=p.Y); */
			FieldOperations.fe_sq(out r.Z, ref p.Y);

			/* qhasm: B=2*Z1^2 */
			/* asm 1: fe_sq2(>B=fe#4,<Z1=fe#13); */
			/* asm 2: fe_sq2(>B=r.T,<Z1=p.Z); */
			FieldOperations.fe_sq2(out r.T, ref p.Z);

			/* qhasm: A=X1+Y1 */
			/* asm 1: fe_add(>A=fe#2,<X1=fe#11,<Y1=fe#12); */
			/* asm 2: fe_add(>A=r.Y,<X1=p.X,<Y1=p.Y); */
			FieldOperations.fe_add(out r.Y, ref p.X, ref p.Y);

			/* qhasm: AA=A^2 */
			/* asm 1: fe_sq(>AA=fe#5,<A=fe#2); */
			/* asm 2: fe_sq(>AA=t0,<A=r.Y); */
			FieldOperations.fe_sq(out t0, ref r.Y);

			/* qhasm: Y3=YY+XX */
			/* asm 1: fe_add(>Y3=fe#2,<YY=fe#3,<XX=fe#1); */
			/* asm 2: fe_add(>Y3=r.Y,<YY=r.Z,<XX=r.X); */
			FieldOperations.fe_add(out r.Y, ref r.Z, ref r.X);

			/* qhasm: Z3=YY-XX */
			/* asm 1: fe_sub(>Z3=fe#3,<YY=fe#3,<XX=fe#1); */
			/* asm 2: fe_sub(>Z3=r.Z,<YY=r.Z,<XX=r.X); */
			FieldOperations.fe_sub(out r.Z, ref r.Z, ref r.X);

			/* qhasm: X3=AA-Y3 */
			/* asm 1: fe_sub(>X3=fe#1,<AA=fe#5,<Y3=fe#2); */
			/* asm 2: fe_sub(>X3=r.X,<AA=t0,<Y3=r.Y); */
			FieldOperations.fe_sub(out r.X, ref t0, ref r.Y);

			/* qhasm: T3=B-Z3 */
			/* asm 1: fe_sub(>T3=fe#4,<B=fe#4,<Z3=fe#3); */
			/* asm 2: fe_sub(>T3=r.T,<B=r.T,<Z3=r.Z); */
			FieldOperations.fe_sub(out r.T, ref r.T, ref r.Z);

			/* qhasm: return */

		}
        /*
         * r = 2 * p
         */

        public static void ge_p2_dbl(out GroupElementP1P1 r, ref GroupElementP2 p)
        {
            FieldElement t0;

            /* qhasm: XX=X1^2 */
            /* asm 1: fe_sq(>XX=fe#1,<X1=fe#11); */
            /* asm 2: fe_sq(>XX=r.X,<X1=p.X); */
            FieldOperations.fe_sq(out r.X, ref p.X);

            /* qhasm: YY=Y1^2 */
            /* asm 1: fe_sq(>YY=fe#3,<Y1=fe#12); */
            /* asm 2: fe_sq(>YY=r.Z,<Y1=p.Y); */
            FieldOperations.fe_sq(out r.Z, ref p.Y);

            /* qhasm: B=2*Z1^2 */
            /* asm 1: fe_sq2(>B=fe#4,<Z1=fe#13); */
            /* asm 2: fe_sq2(>B=r.T,<Z1=p.Z); */
            FieldOperations.fe_sq2(out r.T, ref p.Z);

            /* qhasm: A=X1+Y1 */
            /* asm 1: fe_add(>A=fe#2,<X1=fe#11,<Y1=fe#12); */
            /* asm 2: fe_add(>A=r.Y,<X1=p.X,<Y1=p.Y); */
            FieldOperations.fe_add(out r.Y, ref p.X, ref p.Y);

            /* qhasm: AA=A^2 */
            /* asm 1: fe_sq(>AA=fe#5,<A=fe#2); */
            /* asm 2: fe_sq(>AA=t0,<A=r.Y); */
            FieldOperations.fe_sq(out t0, ref r.Y);

            /* qhasm: Y3=YY+XX */
            /* asm 1: fe_add(>Y3=fe#2,<YY=fe#3,<XX=fe#1); */
            /* asm 2: fe_add(>Y3=r.Y,<YY=r.Z,<XX=r.X); */
            FieldOperations.fe_add(out r.Y, ref r.Z, ref r.X);

            /* qhasm: Z3=YY-XX */
            /* asm 1: fe_sub(>Z3=fe#3,<YY=fe#3,<XX=fe#1); */
            /* asm 2: fe_sub(>Z3=r.Z,<YY=r.Z,<XX=r.X); */
            FieldOperations.fe_sub(out r.Z, ref r.Z, ref r.X);

            /* qhasm: X3=AA-Y3 */
            /* asm 1: fe_sub(>X3=fe#1,<AA=fe#5,<Y3=fe#2); */
            /* asm 2: fe_sub(>X3=r.X,<AA=t0,<Y3=r.Y); */
            FieldOperations.fe_sub(out r.X, ref t0, ref r.Y);

            /* qhasm: T3=B-Z3 */
            /* asm 1: fe_sub(>T3=fe#4,<B=fe#4,<Z3=fe#3); */
            /* asm 2: fe_sub(>T3=r.T,<B=r.T,<Z3=r.Z); */
            FieldOperations.fe_sub(out r.T, ref r.T, ref r.Z);

            /* qhasm: return */
        }
Exemple #9
0
        /*
         *      r = p + q
         */

        internal static void ge_add(out GroupElementP1P1 r, ref GroupElementP3 p, ref GroupElementCached q)
        {
            FieldElement t0;

            /* qhasm: enter GroupElementadd */

            /* qhasm: fe X1 */

            /* qhasm: fe Y1 */

            /* qhasm: fe Z1 */

            /* qhasm: fe Z2 */

            /* qhasm: fe T1 */

            /* qhasm: fe ZZ */

            /* qhasm: fe YpX2 */

            /* qhasm: fe YmX2 */

            /* qhasm: fe T2d2 */

            /* qhasm: fe X3 */

            /* qhasm: fe Y3 */

            /* qhasm: fe Z3 */

            /* qhasm: fe T3 */

            /* qhasm: fe YpX1 */

            /* qhasm: fe YmX1 */

            /* qhasm: fe A */

            /* qhasm: fe B */

            /* qhasm: fe C */

            /* qhasm: fe D */

            /* qhasm: YpX1 = Y1+X1 */
            /* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
            /* asm 2: fe_add(>YpX1=r.X,<Y1=p.Y,<X1=p.X); */
            FieldOperations.fe_add(out r.X, ref p.Y, ref p.X);

            /* qhasm: YmX1 = Y1-X1 */
            /* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
            /* asm 2: fe_sub(>YmX1=r.Y,<Y1=p.Y,<X1=p.X); */
            FieldOperations.fe_sub(out r.Y, ref p.Y, ref p.X);

            /* qhasm: A = YpX1*YpX2 */
            /* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<YpX2=fe#15); */
            /* asm 2: fe_mul(>A=r.Z,<YpX1=r.X,<YpX2=q.YplusX); */
            FieldOperations.fe_mul(out r.Z, ref r.X, ref q.YplusX);

            /* qhasm: B = YmX1*YmX2 */
            /* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<YmX2=fe#16); */
            /* asm 2: fe_mul(>B=r.Y,<YmX1=r.Y,<YmX2=q.YminusX); */
            FieldOperations.fe_mul(out r.Y, ref r.Y, ref q.YminusX);

            /* qhasm: C = T2d2*T1 */
            /* asm 1: fe_mul(>C=fe#4,<T2d2=fe#18,<T1=fe#14); */
            /* asm 2: fe_mul(>C=r.T,<T2d2=q.T2d,<T1=p.T); */
            FieldOperations.fe_mul(out r.T, ref q.T2d, ref p.T);

            /* qhasm: ZZ = Z1*Z2 */
            /* asm 1: fe_mul(>ZZ=fe#1,<Z1=fe#13,<Z2=fe#17); */
            /* asm 2: fe_mul(>ZZ=r.X,<Z1=p.Z,<Z2=q.Z); */
            FieldOperations.fe_mul(out r.X, ref p.Z, ref q.Z);

            /* qhasm: D = 2*ZZ */
            /* asm 1: fe_add(>D=fe#5,<ZZ=fe#1,<ZZ=fe#1); */
            /* asm 2: fe_add(>D=t0,<ZZ=r.X,<ZZ=r.X); */
            FieldOperations.fe_add(out t0, ref r.X, ref r.X);

            /* qhasm: X3 = A-B */
            /* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
            /* asm 2: fe_sub(>X3=r.X,<A=r.Z,<B=r.Y); */
            FieldOperations.fe_sub(out r.X, ref r.Z, ref r.Y);

            /* qhasm: Y3 = A+B */
            /* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
            /* asm 2: fe_add(>Y3=r.Y,<A=r.Z,<B=r.Y); */
            FieldOperations.fe_add(out r.Y, ref r.Z, ref r.Y);

            /* qhasm: Z3 = D+C */
            /* asm 1: fe_add(>Z3=fe#3,<D=fe#5,<C=fe#4); */
            /* asm 2: fe_add(>Z3=r.Z,<D=t0,<C=r.T); */
            FieldOperations.fe_add(out r.Z, ref t0, ref r.T);

            /* qhasm: T3 = D-C */
            /* asm 1: fe_sub(>T3=fe#4,<D=fe#5,<C=fe#4); */
            /* asm 2: fe_sub(>T3=r.T,<D=t0,<C=r.T); */
            FieldOperations.fe_sub(out r.T, ref t0, ref r.T);

            /* qhasm: return */
        }
Exemple #10
0
		/*
		r = p - q
		*/
		public static void ge_msub(out GroupElementP1P1 r, ref  GroupElementP3 p, ref  GroupElementPreComp q)
		{
			FieldElement t0;
Exemple #11
0
		/*
		r = p + q
		*/

		internal static void ge_add(out GroupElementP1P1 r, ref GroupElementP3 p, ref GroupElementCached q)
		{
			FieldElement t0;
Exemple #12
0
		/*
		r = p + q
		*/

		internal static void ge_add(out GroupElementP1P1 r, ref GroupElementP3 p, ref GroupElementCached q)
		{
			FieldElement t0;

			/* qhasm: enter GroupElementadd */

			/* qhasm: fe X1 */

			/* qhasm: fe Y1 */

			/* qhasm: fe Z1 */

			/* qhasm: fe Z2 */

			/* qhasm: fe T1 */

			/* qhasm: fe ZZ */

			/* qhasm: fe YpX2 */

			/* qhasm: fe YmX2 */

			/* qhasm: fe T2d2 */

			/* qhasm: fe X3 */

			/* qhasm: fe Y3 */

			/* qhasm: fe Z3 */

			/* qhasm: fe T3 */

			/* qhasm: fe YpX1 */

			/* qhasm: fe YmX1 */

			/* qhasm: fe A */

			/* qhasm: fe B */

			/* qhasm: fe C */

			/* qhasm: fe D */

			/* qhasm: YpX1 = Y1+X1 */
			/* asm 1: fe_add(>YpX1=fe#1,<Y1=fe#12,<X1=fe#11); */
			/* asm 2: fe_add(>YpX1=r.X,<Y1=p.Y,<X1=p.X); */
			FieldOperations.fe_add(out r.X, ref p.Y, ref p.X);

			/* qhasm: YmX1 = Y1-X1 */
			/* asm 1: fe_sub(>YmX1=fe#2,<Y1=fe#12,<X1=fe#11); */
			/* asm 2: fe_sub(>YmX1=r.Y,<Y1=p.Y,<X1=p.X); */
			FieldOperations.fe_sub(out r.Y, ref p.Y, ref p.X);

			/* qhasm: A = YpX1*YpX2 */
			/* asm 1: fe_mul(>A=fe#3,<YpX1=fe#1,<YpX2=fe#15); */
			/* asm 2: fe_mul(>A=r.Z,<YpX1=r.X,<YpX2=q.YplusX); */
			FieldOperations.fe_mul(out r.Z, ref r.X, ref q.YplusX);

			/* qhasm: B = YmX1*YmX2 */
			/* asm 1: fe_mul(>B=fe#2,<YmX1=fe#2,<YmX2=fe#16); */
			/* asm 2: fe_mul(>B=r.Y,<YmX1=r.Y,<YmX2=q.YminusX); */
			FieldOperations.fe_mul(out r.Y, ref r.Y, ref q.YminusX);

			/* qhasm: C = T2d2*T1 */
			/* asm 1: fe_mul(>C=fe#4,<T2d2=fe#18,<T1=fe#14); */
			/* asm 2: fe_mul(>C=r.T,<T2d2=q.T2d,<T1=p.T); */
			FieldOperations.fe_mul(out r.T, ref q.T2d, ref p.T);

			/* qhasm: ZZ = Z1*Z2 */
			/* asm 1: fe_mul(>ZZ=fe#1,<Z1=fe#13,<Z2=fe#17); */
			/* asm 2: fe_mul(>ZZ=r.X,<Z1=p.Z,<Z2=q.Z); */
			FieldOperations.fe_mul(out r.X, ref p.Z, ref q.Z);

			/* qhasm: D = 2*ZZ */
			/* asm 1: fe_add(>D=fe#5,<ZZ=fe#1,<ZZ=fe#1); */
			/* asm 2: fe_add(>D=t0,<ZZ=r.X,<ZZ=r.X); */
			FieldOperations.fe_add(out t0, ref r.X, ref r.X);

			/* qhasm: X3 = A-B */
			/* asm 1: fe_sub(>X3=fe#1,<A=fe#3,<B=fe#2); */
			/* asm 2: fe_sub(>X3=r.X,<A=r.Z,<B=r.Y); */
			FieldOperations.fe_sub(out r.X, ref r.Z, ref r.Y);

			/* qhasm: Y3 = A+B */
			/* asm 1: fe_add(>Y3=fe#2,<A=fe#3,<B=fe#2); */
			/* asm 2: fe_add(>Y3=r.Y,<A=r.Z,<B=r.Y); */
			FieldOperations.fe_add(out r.Y, ref r.Z, ref r.Y);

			/* qhasm: Z3 = D+C */
			/* asm 1: fe_add(>Z3=fe#3,<D=fe#5,<C=fe#4); */
			/* asm 2: fe_add(>Z3=r.Z,<D=t0,<C=r.T); */
			FieldOperations.fe_add(out r.Z, ref t0, ref r.T);

			/* qhasm: T3 = D-C */
			/* asm 1: fe_sub(>T3=fe#4,<D=fe#5,<C=fe#4); */
			/* asm 2: fe_sub(>T3=r.T,<D=t0,<C=r.T); */
			FieldOperations.fe_sub(out r.T, ref t0, ref r.T);

			/* qhasm: return */
		}
Exemple #13
0
		/*
		r = 2 * p
		*/

		public static void ge_p2_dbl(out GroupElementP1P1 r, ref GroupElementP2 p)
		{
			FieldElement t0;
Exemple #14
0
		/*
		r = 2 * p
		*/
		public static void ge_p3_dbl(out GroupElementP1P1 r, ref GroupElementP3 p)
		{
			GroupElementP2 q;
			ge_p3_to_p2(out q, ref p);
			ge_p2_dbl(out r, ref q);
		}
Exemple #15
0
 /*
  *      r = p
  */
 internal static void ge_p1p1_to_p2(out GroupElementP2 r, ref GroupElementP1P1 p)
 {
     FieldOperations.fe_mul(out r.X, ref p.X, ref p.T);
     FieldOperations.fe_mul(out r.Y, ref p.Y, ref p.Z);
     FieldOperations.fe_mul(out r.Z, ref p.Z, ref p.T);
 }
Exemple #16
0
		/*
		r = p - q
		*/

		public static void ge_sub(out GroupElementP1P1 r, ref  GroupElementP3 p, ref  GroupElementCached q)
		{
			FieldElement t0;