http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/pair256.c ---------------------------------------------------------------------- diff --git a/version3/c/pair256.c b/version3/c/pair256.c deleted file mode 100644 index 5608372..0000000 --- a/version3/c/pair256.c +++ /dev/null @@ -1,864 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -/* AMCL BLS Curve pairing functions */ - -//#define HAS_MAIN - -#include "pair256_ZZZ.h" - -/* Line function */ -static void PAIR_ZZZ_line(FP48_YYY *v,ECP8_ZZZ *A,ECP8_ZZZ *B,FP_YYY *Qx,FP_YYY *Qy) -{ - //FP2_YYY t; - - FP8_YYY X1,Y1,T1,T2; - FP8_YYY XX,YY,ZZ,YZ; - FP16_YYY a,b,c; - - if (A==B) - { - /* doubling */ - FP8_YYY_copy(&XX,&(A->x)); //FP8_YYY XX=new FP8_YYY(A.getx()); //X - FP8_YYY_copy(&YY,&(A->y)); //FP8_YYY YY=new FP8_YYY(A.gety()); //Y - FP8_YYY_copy(&ZZ,&(A->z)); //FP8_YYY ZZ=new FP8_YYY(A.getz()); //Z - - - FP8_YYY_copy(&YZ,&YY); //FP8_YYY YZ=new FP8_YYY(YY); //Y - FP8_YYY_mul(&YZ,&YZ,&ZZ); //YZ.mul(ZZ); //YZ - FP8_YYY_sqr(&XX,&XX); //XX.sqr(); //X^2 - FP8_YYY_sqr(&YY,&YY); //YY.sqr(); //Y^2 - FP8_YYY_sqr(&ZZ,&ZZ); //ZZ.sqr(); //Z^2 - - FP8_YYY_imul(&YZ,&YZ,4); //YZ.imul(4); - FP8_YYY_neg(&YZ,&YZ); //YZ.neg(); - FP8_YYY_norm(&YZ); //YZ.norm(); //-4YZ - - FP8_YYY_imul(&XX,&XX,6); //6X^2 - //FP2_YYY_from_FP(&t,Qx); - FP8_YYY_tmul(&XX,&XX,Qx); //6X^2.Xs - - FP8_YYY_imul(&ZZ,&ZZ,3*CURVE_B_I_ZZZ); //3Bz^2 - //FP2_YYY_from_FP(&t,Qy); - FP8_YYY_tmul(&YZ,&YZ,Qy); //-4YZ.Ys - -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP8_YYY_div_2i(&ZZ); //6(b/i)z^2 -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_YYY_times_i(&ZZ); - FP8_YYY_add(&ZZ,&ZZ,&ZZ); // 6biz^2 - FP8_YYY_times_i(&YZ); - FP8_YYY_norm(&YZ); -#endif - FP8_YYY_norm(&ZZ); // 6bi.Z^2 - - FP8_YYY_add(&YY,&YY,&YY); // 2y^2 - FP8_YYY_sub(&ZZ,&ZZ,&YY); // - FP8_YYY_norm(&ZZ); // 6b.Z^2-2Y^2 - - FP16_YYY_from_FP8s(&a,&YZ,&ZZ); // -4YZ.Ys | 6b.Z^2-2Y^2 | 6X^2.Xs -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP16_YYY_from_FP8(&b,&XX); - FP16_YYY_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP16_YYY_zero(&b); - FP16_YYY_from_FP8H(&c,&XX); -#endif - - ECP8_ZZZ_dbl(A); //A.dbl(); - } - else - { - /* addition */ - - FP8_YYY_copy(&X1,&(A->x)); //FP8_YYY X1=new FP8_YYY(A.getx()); // X1 - FP8_YYY_copy(&Y1,&(A->y)); //FP8_YYY Y1=new FP8_YYY(A.gety()); // Y1 - FP8_YYY_copy(&T1,&(A->z)); //FP8_YYY T1=new FP8_YYY(A.getz()); // Z1 - - FP8_YYY_copy(&T2,&T1); //FP8_YYY T2=new FP8_YYY(A.getz()); // Z1 - - FP8_YYY_mul(&T1,&T1,&(B->y)); //T1.mul(B.gety()); // T1=Z1.Y2 - FP8_YYY_mul(&T2,&T2,&(B->x)); //T2.mul(B.getx()); // T2=Z1.X2 - - FP8_YYY_sub(&X1,&X1,&T2); //X1.sub(T2); - FP8_YYY_norm(&X1); //X1.norm(); // X1=X1-Z1.X2 - FP8_YYY_sub(&Y1,&Y1,&T1); //Y1.sub(T1); - FP8_YYY_norm(&Y1); //Y1.norm(); // Y1=Y1-Z1.Y2 - - FP8_YYY_copy(&T1,&X1); //T1.copy(X1); // T1=X1-Z1.X2 - //FP2_YYY_from_FP(&t,Qy); - FP8_YYY_tmul(&X1,&X1,Qy); //X1.pmul(Qy); // X1=(X1-Z1.X2).Ys -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP8_YYY_times_i(&X1); - FP8_YYY_norm(&X1); -#endif - - FP8_YYY_mul(&T1,&T1,&(B->y)); //T1.mul(B.gety()); // T1=(X1-Z1.X2).Y2 - - FP8_YYY_copy(&T2,&Y1); //T2.copy(Y1); // T2=Y1-Z1.Y2 - FP8_YYY_mul(&T2,&T2,&(B->x)); //T2.mul(B.getx()); // T2=(Y1-Z1.Y2).X2 - FP8_YYY_sub(&T2,&T2,&T1); //T2.sub(T1); - FP8_YYY_norm(&T2); //T2.norm(); // T2=(Y1-Z1.Y2).X2 - (X1-Z1.X2).Y2 - //FP2_YYY_from_FP(&t,Qx); - FP8_YYY_tmul(&Y1,&Y1,Qx); //Y1.pmul(Qx); - FP8_YYY_neg(&Y1,&Y1); //Y1.neg(); - FP8_YYY_norm(&Y1); //Y1.norm(); // Y1=-(Y1-Z1.Y2).Xs - - FP16_YYY_from_FP8s(&a,&X1,&T2); // (X1-Z1.X2).Ys | (Y1-Z1.Y2).X2 - (X1-Z1.X2).Y2 | - (Y1-Z1.Y2).Xs -#if SEXTIC_TWIST_ZZZ==D_TYPE - FP16_YYY_from_FP8(&b,&Y1); //b=new FP4(Y1); - FP16_YYY_zero(&c); -#endif -#if SEXTIC_TWIST_ZZZ==M_TYPE - FP16_YYY_zero(&b); - FP16_YYY_from_FP8H(&c,&Y1); //b=new FP4(Y1); -#endif - ECP8_ZZZ_add(A,B); // A.add(B); - } - - FP48_YYY_from_FP16s(v,&a,&b,&c); -} - -/* Optimal R-ate pairing r=e(P,Q) */ -void PAIR_ZZZ_ate(FP48_YYY *r,ECP8_ZZZ *P1,ECP_ZZZ *Q1) -{ - BIG_XXX x,n,n3; - FP_YYY Qx,Qy; - int i,j,nb,bt; - ECP8_ZZZ A,NP,P; - ECP_ZZZ Q; - FP48_YYY lv; - - BIG_XXX_rcopy(x,CURVE_Bnx_ZZZ); - - BIG_XXX_copy(n,x); - - //BIG_XXX_norm(n); - BIG_XXX_pmul(n3,n,3); - BIG_XXX_norm(n3); - - ECP8_ZZZ_copy(&P,P1); - ECP_ZZZ_copy(&Q,Q1); - - ECP8_ZZZ_affine(&P); - ECP_ZZZ_affine(&Q); - - - FP_YYY_copy(&Qx,&(Q.x)); - FP_YYY_copy(&Qy,&(Q.y)); - - ECP8_ZZZ_copy(&A,&P); - ECP8_ZZZ_copy(&NP,&P); ECP8_ZZZ_neg(&NP); - - FP48_YYY_one(r); - nb=BIG_XXX_nbits(n3); // n3 - - j=0; - /* Main Miller Loop */ - for (i=nb-2; i>=1; i--) - { - j++; - FP48_YYY_sqr(r,r); - PAIR_ZZZ_line(&lv,&A,&A,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); -//printf("r= "); FP48_YYY_output(r); printf("\n"); -//if (j>3) exit(0); - bt= BIG_XXX_bit(n3,i)-BIG_XXX_bit(n,i); // BIG_XXX_bit(n,i); - if (bt==1) - { -//printf("bt=1\n"); - PAIR_ZZZ_line(&lv,&A,&P,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - } - if (bt==-1) - { -//printf("bt=-1\n"); - //ECP8_ZZZ_neg(P); - PAIR_ZZZ_line(&lv,&A,&NP,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - //ECP8_ZZZ_neg(P); - } - - } - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(r,r); -#endif - -} - -/* Optimal R-ate double pairing e(P,Q).e(R,S) */ -void PAIR_ZZZ_double_ate(FP48_YYY *r,ECP8_ZZZ *P1,ECP_ZZZ *Q1,ECP8_ZZZ *R1,ECP_ZZZ *S1) -{ - BIG_XXX x,n,n3; - FP_YYY Qx,Qy,Sx,Sy; - int i,nb,bt; - ECP8_ZZZ A,B,NP,NR,P,R; - ECP_ZZZ Q,S; - FP48_YYY lv; - - BIG_XXX_rcopy(x,CURVE_Bnx_ZZZ); - BIG_XXX_copy(n,x); - - //BIG_XXX_norm(n); - BIG_XXX_pmul(n3,n,3); - BIG_XXX_norm(n3); - - ECP8_ZZZ_copy(&P,P1); - ECP_ZZZ_copy(&Q,Q1); - - ECP8_ZZZ_affine(&P); - ECP_ZZZ_affine(&Q); - - ECP8_ZZZ_copy(&R,R1); - ECP_ZZZ_copy(&S,S1); - - ECP8_ZZZ_affine(&R); - ECP_ZZZ_affine(&S); - - FP_YYY_copy(&Qx,&(Q.x)); - FP_YYY_copy(&Qy,&(Q.y)); - - FP_YYY_copy(&Sx,&(S.x)); - FP_YYY_copy(&Sy,&(S.y)); - - ECP8_ZZZ_copy(&A,&P); - ECP8_ZZZ_copy(&B,&R); - ECP8_ZZZ_copy(&NP,&P); ECP8_ZZZ_neg(&NP); - ECP8_ZZZ_copy(&NR,&R); ECP8_ZZZ_neg(&NR); - - - FP48_YYY_one(r); - nb=BIG_XXX_nbits(n3); - - /* Main Miller Loop */ - for (i=nb-2; i>=1; i--) - { - FP48_YYY_sqr(r,r); - PAIR_ZZZ_line(&lv,&A,&A,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - - PAIR_ZZZ_line(&lv,&B,&B,&Sx,&Sy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - - bt=BIG_XXX_bit(n3,i)-BIG_XXX_bit(n,i); // bt=BIG_XXX_bit(n,i); - if (bt==1) - { - PAIR_ZZZ_line(&lv,&A,&P,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - - PAIR_ZZZ_line(&lv,&B,&R,&Sx,&Sy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - } - if (bt==-1) - { - //ECP8_ZZZ_neg(P); - PAIR_ZZZ_line(&lv,&A,&NP,&Qx,&Qy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - //ECP8_ZZZ_neg(P); - //ECP8_ZZZ_neg(R); - PAIR_ZZZ_line(&lv,&B,&NR,&Sx,&Sy); - FP48_YYY_smul(r,&lv,SEXTIC_TWIST_ZZZ); - //ECP8_ZZZ_neg(R); - } - } - - - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(r,r); -#endif - -} - -/* final exponentiation - keep separate for multi-pairings and to avoid thrashing stack */ - -void PAIR_ZZZ_fexp(FP48_YYY *r) -{ - FP2_YYY X; - BIG_XXX x; - FP_YYY a,b; - FP48_YYY t1,t2,t3,t7; - - BIG_XXX_rcopy(x,CURVE_Bnx_ZZZ); - FP_YYY_rcopy(&a,Fra_YYY); - FP_YYY_rcopy(&b,Frb_YYY); - FP2_YYY_from_FPs(&X,&a,&b); - - /* Easy part of final exp - r^(p^24-1)(p^8+1)*/ - - FP48_YYY_inv(&t7,r); - FP48_YYY_conj(r,r); - - FP48_YYY_mul(r,&t7); - FP48_YYY_copy(&t7,r); - - FP48_YYY_frob(r,&X,8); - - FP48_YYY_mul(r,&t7); - -// Ghamman & Fouotsa Method for hard part of fexp - r^e1 . r^p^e2 . r^p^2^e3 .. - -// e0 = u^17 - 2*u^16 + u^15 - u^9 + 2*u^8 - u^7 + 3 // .p^0 -// e1 = u^16 - 2*u^15 + u^14 - u^8 + 2*u^7 - u^6 // .p^1 -// e2 = u^15 - 2*u^14 + u^13 - u^7 + 2*u^6 - u^5 -// e3 = u^14 - 2*u^13 + u^12 - u^6 + 2*u^5 - u^4 -// e4 = u^13 - 2*u^12 + u^11 - u^5 + 2*u^4 - u^3 -// e5 = u^12 - 2*u^11 + u^10 - u^4 + 2*u^3 - u^2 -// e6 = u^11 - 2*u^10 + u^9 - u^3 + 2*u^2 - u -// e7 = u^10 - 2*u^9 + u^8 - u^2 + 2*u - 1 -// e8 = u^9 - 2*u^8 + u^7 -// e9 = u^8 - 2*u^7 + u^6 -// e10 = u^7 - 2*u^6 + u^5 -// e11 = u^6 - 2*u^5 + u^4 -// e12 = u^5 - 2*u^4 + u^3 -// e13 = u^4 - 2*u^3 + u^2 -// e14 = u^3 - 2*u^2 + u -// e15 = u^2 - 2*u + 1 - -// e15 = u^2-2*u+1 -// e14 = u.e15 -// e13 = u.e14 -// e12 = u.e13 -// e11 = u.e12 -// e10 = u.e11 -// e9 = u.e10 -// e8 = u.e9 -// e7 = u.e8 - e15 -// e6 = u.e7 -// e5 = u.e6 -// e4 = u.e5 -// e3 = u.e4 -// e2 = u.e3 -// e1 = u.e2 -// e0 = u.e1 + 3 - -// f^e0.f^e1^p.f^e2^p^2.. .. f^e14^p^14.f^e15^p^15 - - FP48_YYY_usqr(&t7,r); // t7=f^2 - FP48_YYY_pow(&t1,&t7,x); // t1=f^2u - - BIG_XXX_fshr(x,1); - FP48_YYY_pow(&t2,&t1,x); // t2=f^2u^(u/2) = f^u^2 - BIG_XXX_fshl(x,1); // x must be even - -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - - FP48_YYY_conj(&t3,&t1); // t3=f^-2u - FP48_YYY_mul(&t2,&t3); // t2=f^u^2.f^-2u - FP48_YYY_mul(&t2,r); // t2=f^u^2.f^-2u.f = f^(u^2-2u+1) = f^e15 - - FP48_YYY_mul(r,&t7); // f^3 - - FP48_YYY_pow(&t1,&t2,x); // f^e15^u = f^(u.e15) = f^(u^3-2u^2+u) = f^(e14) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,14); // f^(u^3-2u^2+u)^p^14 - FP48_YYY_mul(r,&t3); // f^3.f^(u^3-2u^2+u)^p^14 - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e14) = f^(u^4-2u^3+u^2) = f^(e13) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,13); // f^(e13)^p^13 - FP48_YYY_mul(r,&t3); // f^3.f^(u^3-2u^2+u)^p^14.f^(u^4-2u^3+u^2)^p^13 - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e13) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,12); // f^(e12)^p^12 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e12) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,11); // f^(e11)^p^11 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e11) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,10); // f^(e10)^p^10 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e10) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,9); // f^(e9)^p^9 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e9) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,8); // f^(e8)^p^8 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e8) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_conj(&t3,&t2); - FP48_YYY_mul(&t1,&t3); // f^(u.e8).f^-e15 - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,7); // f^(e7)^p^7 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e7) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,6); // f^(e6)^p^6 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e6) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,5); // f^(e5)^p^5 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e5) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,4); // f^(e4)^p^4 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e4) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,3); // f^(e3)^p^3 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e3) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,2); // f^(e2)^p^2 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e2) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_copy(&t3,&t1); - FP48_YYY_frob(&t3,&X,1); // f^(e1)^p^1 - FP48_YYY_mul(r,&t3); - - FP48_YYY_pow(&t1,&t1,x); // f^(u.e1) -#if SIGN_OF_X_ZZZ==NEGATIVEX - FP48_YYY_conj(&t1,&t1); -#endif - FP48_YYY_mul(r,&t1); // r.f^e0 - - FP48_YYY_frob(&t2,&X,15); // f^(e15.p^15) - FP48_YYY_mul(r,&t2); - - - FP48_YYY_reduce(r); - -} - -#ifdef USE_GLV_ZZZ -/* GLV method */ -static void glv(BIG_XXX u[2],BIG_XXX e) -{ - -// -(x^8).P = (Beta.x,y) - - BIG_XXX x,x2,q; - BIG_XXX_rcopy(x,CURVE_Bnx_ZZZ); - - BIG_XXX_smul(x2,x,x); - BIG_XXX_smul(x,x2,x2); - BIG_XXX_smul(x2,x,x); - - BIG_XXX_copy(u[0],e); - BIG_XXX_mod(u[0],x2); - BIG_XXX_copy(u[1],e); - BIG_XXX_sdiv(u[1],x2); - - BIG_XXX_rcopy(q,CURVE_Order_ZZZ); - BIG_XXX_sub(u[1],q,u[1]); - - - return; -} -#endif // USE_GLV - -/* Galbraith & Scott Method */ -static void gs(BIG_XXX u[16],BIG_XXX e) -{ - int i; - - BIG_XXX x,w,q; - BIG_XXX_rcopy(q,CURVE_Order_ZZZ); - BIG_XXX_rcopy(x,CURVE_Bnx_ZZZ); - BIG_XXX_copy(w,e); - - for (i=0; i<15; i++) - { - BIG_XXX_copy(u[i],w); - BIG_XXX_mod(u[i],x); - BIG_XXX_sdiv(w,x); - } - BIG_XXX_copy(u[15],w); - -/* */ -#if SIGN_OF_X_ZZZ==NEGATIVEX - BIG_XXX_modneg(u[1],u[1],q); - BIG_XXX_modneg(u[3],u[3],q); - BIG_XXX_modneg(u[5],u[5],q); - BIG_XXX_modneg(u[7],u[7],q); - BIG_XXX_modneg(u[9],u[9],q); - BIG_XXX_modneg(u[11],u[11],q); - BIG_XXX_modneg(u[13],u[13],q); - BIG_XXX_modneg(u[15],u[15],q); -#endif - - - return; -} - -/* Multiply P by e in group G1 */ -void PAIR_ZZZ_G1mul(ECP_ZZZ *P,BIG_XXX e) -{ -#ifdef USE_GLV_ZZZ /* Note this method is patented */ - int np,nn; - ECP_ZZZ Q; - FP_YYY cru; - BIG_XXX t,q; - BIG_XXX u[2]; - - BIG_XXX_rcopy(q,CURVE_Order_ZZZ); - glv(u,e); - - //ECP_ZZZ_affine(P); - ECP_ZZZ_copy(&Q,P); ECP_ZZZ_affine(&Q); - FP_YYY_rcopy(&cru,CURVE_Cru_ZZZ); - FP_YYY_mul(&(Q.x),&(Q.x),&cru); - - /* note that -a.B = a.(-B). Use a or -a depending on which is smaller */ - - np=BIG_XXX_nbits(u[0]); - BIG_XXX_modneg(t,u[0],q); - nn=BIG_XXX_nbits(t); - if (nn<np) - { - BIG_XXX_copy(u[0],t); - ECP_ZZZ_neg(P); - } - - np=BIG_XXX_nbits(u[1]); - BIG_XXX_modneg(t,u[1],q); - nn=BIG_XXX_nbits(t); - if (nn<np) - { - BIG_XXX_copy(u[1],t); - ECP_ZZZ_neg(&Q); - } - BIG_XXX_norm(u[0]); - BIG_XXX_norm(u[1]); - ECP_ZZZ_mul2(P,&Q,u[0],u[1]); - -#else - ECP_ZZZ_mul(P,e); -#endif -} - -/* Multiply P by e in group G2 */ -void PAIR_ZZZ_G2mul(ECP8_ZZZ *P,BIG_XXX e) -{ -#ifdef USE_GS_G2_ZZZ /* Well I didn't patent it :) */ - int i,np,nn; - ECP8_ZZZ Q[16]; - FP2_YYY X[3]; - BIG_XXX x,y,u[16]; - - ECP8_ZZZ_frob_constants(X); - - BIG_XXX_rcopy(y,CURVE_Order_ZZZ); - gs(u,e); - - //ECP8_ZZZ_affine(P); - - ECP8_ZZZ_copy(&Q[0],P); - for (i=1; i<16; i++) - { - ECP8_ZZZ_copy(&Q[i],&Q[i-1]); - ECP8_ZZZ_frob(&Q[i],X,1); - } - - for (i=0; i<16; i++) - { - np=BIG_XXX_nbits(u[i]); - BIG_XXX_modneg(x,u[i],y); - nn=BIG_XXX_nbits(x); - if (nn<np) - { - BIG_XXX_copy(u[i],x); - ECP8_ZZZ_neg(&Q[i]); - } - BIG_XXX_norm(u[i]); - //ECP8_ZZZ_affine(&Q[i]); - } - - ECP8_ZZZ_mul16(P,Q,u); - -#else - ECP8_ZZZ_mul(P,e); -#endif -} - -/* f=f^e */ -void PAIR_ZZZ_GTpow(FP48_YYY *f,BIG_XXX e) -{ -#ifdef USE_GS_GT_ZZZ /* Note that this option requires a lot of RAM! Maybe better to use compressed XTR method, see FP16.cpp */ - int i,np,nn; - FP48_YYY g[16]; - FP2_YYY X; - BIG_XXX t,q; - FP_YYY fx,fy; - BIG_XXX u[16]; - - FP_YYY_rcopy(&fx,Fra_YYY); - FP_YYY_rcopy(&fy,Frb_YYY); - FP2_YYY_from_FPs(&X,&fx,&fy); - - BIG_XXX_rcopy(q,CURVE_Order_ZZZ); - gs(u,e); - - FP48_YYY_copy(&g[0],f); - for (i=1; i<16; i++) - { - FP48_YYY_copy(&g[i],&g[i-1]); - FP48_YYY_frob(&g[i],&X,1); - } - - for (i=0; i<16; i++) - { - np=BIG_XXX_nbits(u[i]); - BIG_XXX_modneg(t,u[i],q); - nn=BIG_XXX_nbits(t); - if (nn<np) - { - BIG_XXX_copy(u[i],t); - FP48_YYY_conj(&g[i],&g[i]); - } - BIG_XXX_norm(u[i]); - } - FP48_YYY_pow16(f,g,u); - -#else - FP48_YYY_pow(f,f,e); -#endif -} - -/* test group membership test - no longer needed */ -/* with GT-Strong curve, now only check that m!=1, conj(m)*m==1, and m.m^{p^4}=m^{p^2} */ - -/* -int PAIR_ZZZ_GTmember(FP48_YYY *m) -{ - BIG_XXX a,b; - FP2_YYY X; - FP48_YYY r,w; - if (FP48_YYY_isunity(m)) return 0; - FP48_YYY_conj(&r,m); - FP48_YYY_mul(&r,m); - if (!FP48_YYY_isunity(&r)) return 0; - - BIG_XXX_rcopy(a,CURVE_Fra); - BIG_XXX_rcopy(b,CURVE_Frb); - FP2_YYY_from_BIG_XXXs(&X,a,b); - - - FP48_YYY_copy(&r,m); FP48_YYY_frob(&r,&X); FP48_YYY_frob(&r,&X); - FP48_YYY_copy(&w,&r); FP48_YYY_frob(&w,&X); FP48_YYY_frob(&w,&X); - FP48_YYY_mul(&w,m); - - -#ifndef GT_STRONG - if (!FP48_YYY_equals(&w,&r)) return 0; - - BIG_XXX_rcopy(a,CURVE_Bnx); - - FP48_YYY_copy(&r,m); FP48_YYY_pow(&w,&r,a); FP48_YYY_pow(&w,&w,a); - FP48_YYY_sqr(&r,&w); FP48_YYY_mul(&r,&w); FP48_YYY_sqr(&r,&r); - - FP48_YYY_copy(&w,m); FP48_YYY_frob(&w,&X); - #endif - - return FP48_YYY_equals(&w,&r); -} - -*/ - - -#ifdef HAS_MAIN - -using namespace std; -using namespace ZZZ; - - -// g++ -O2 pair256_BLS48.cpp ecp8_BLS48.cpp fp48_BLS48.cpp fp16_BLS48.cpp fp8_BLS48.cpp fp4_BLS48.cpp fp2_BLS48.cpp ecp_BLS48.cpp fp_BLS48.cpp big_B560_29.cpp rom_curve_BLS48.cpp rom_field_BLS48.cpp rand.cpp hash.cpp oct.cpp -o pair256_BLS48.exe - -int main() -{ - int i; - char byt[32]; - csprng rng; - BIG xa,xb,ya,yb,w,a,b,t1,q,u[2],v[4],m,r,xx,x2,x4,p; - ECP8 P,G; - ECP Q,R; - FP48 g,gp; - FP16 t,c,cp,cpm1,cpm2; - FP8 X,Y; - FP2 x,y,f,Aa,Bb; - FP cru; - - for (i=0;i<32;i++) - byt[i]=i+9; - RAND_seed(&rng,32,byt); - - BIG_rcopy(r,CURVE_Order); - BIG_rcopy(p,Modulus); - - - BIG_rcopy(xa,CURVE_Gx_ZZZ); - BIG_rcopy(ya,CURVE_Gy_ZZZ); - - ECP_ZZZ_set(&Q,xa,ya); - if (Q.inf) printf("Failed to set - point not on curve\n"); - else printf("G1 set success\n"); - - printf("Q= "); - ECP_ZZZ_output(&Q); - printf("\n"); - - ECP8_generator(&P); - - if (P.inf) printf("Failed to set - point not on curve\n"); - else printf("G2 set success\n"); - - BIG_rcopy(a,Fra); - BIG_rcopy(b,Frb); - FP2_from_BIGs(&f,a,b); - - -//exit(0); - - PAIR_ZZZ_ate(&g,&P,&Q); - - printf("gb= "); - FP48_output(&g); - printf("\n"); - PAIR_ZZZ_fexp(&g); - - printf("g= "); - FP48_output(&g); - printf("\n"); - - //FP48_pow(&g,&g,r); - - // printf("g^r= "); - //FP48_output(&g); - //printf("\n"); - - ECP_ZZZ_copy(&R,&Q); - ECP8_copy(&G,&P); - - ECP8_dbl(&G); - ECP_dbl(&R); - ECP_affine(&R); - - PAIR_ZZZ_ate(&g,&G,&Q); - PAIR_ZZZ_fexp(&g); - - printf("g1= "); - FP48_output(&g); - printf("\n"); - - PAIR_ZZZ_ate(&g,&P,&R); - PAIR_ZZZ_fexp(&g); - - printf("g2= "); - FP48_output(&g); - printf("\n"); - - - PAIR_ZZZ_G1mul(&Q,r); - printf("rQ= ");ECP_output(&Q); printf("\n"); - - PAIR_ZZZ_G2mul(&P,r); - printf("rP= ");ECP8_output(&P); printf("\n"); - - //FP48_pow(&g,&g,r); - PAIR_ZZZ_GTpow(&g,r); - printf("g^r= ");FP48_output(&g); printf("\n"); - - - BIG_randomnum(w,r,&rng); - - FP48_copy(&gp,&g); - - PAIR_ZZZ_GTpow(&g,w); - - FP48_trace(&t,&g); - - printf("g^r= ");FP16_output(&t); printf("\n"); - - FP48_compow(&t,&gp,w,r); - - printf("t(g)= "); FP16_output(&t); printf("\n"); - -// PAIR_ZZZ_ate(&g,&P,&R); -// PAIR_ZZZ_fexp(&g); - -// printf("g= "); -// FP48_output(&g); -// printf("\n"); - -// PAIR_ZZZ_GTpow(&g,xa); -} - -#endif
http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/pair256.h ---------------------------------------------------------------------- diff --git a/version3/c/pair256.h b/version3/c/pair256.h deleted file mode 100644 index d270f76..0000000 --- a/version3/c/pair256.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef PAIR256_ZZZ_H -#define PAIR256_ZZZ_H - -#include "fp48_YYY.h" -#include "ecp8_ZZZ.h" -#include "ecp_ZZZ.h" - - -/* Pairing constants */ - -extern const BIG_XXX CURVE_Bnx_ZZZ; /**< BN curve x parameter */ -extern const BIG_XXX CURVE_Cru_ZZZ; /**< BN curve Cube Root of Unity */ - -extern const BIG_XXX CURVE_W_ZZZ[2]; /**< BN curve constant for GLV decomposition */ -extern const BIG_XXX CURVE_SB_ZZZ[2][2]; /**< BN curve constant for GLV decomposition */ -extern const BIG_XXX CURVE_WB_ZZZ[4]; /**< BN curve constant for GS decomposition */ -extern const BIG_XXX CURVE_BB_ZZZ[4][4]; /**< BN curve constant for GS decomposition */ - -/* Pairing function prototypes */ -/** @brief Calculate Miller loop for Optimal ATE pairing e(P,Q) - * - @param r FP48 result of the pairing calculation e(P,Q) - @param P ECP8 instance, an element of G2 - @param Q ECP instance, an element of G1 - - */ -extern void PAIR_ZZZ_ate(FP48_YYY *r,ECP8_ZZZ *P,ECP_ZZZ *Q); -/** @brief Calculate Miller loop for Optimal ATE double-pairing e(P,Q).e(R,S) - * - Faster than calculating two separate pairings - @param r FP48 result of the pairing calculation e(P,Q).e(R,S), an element of GT - @param P ECP8 instance, an element of G2 - @param Q ECP instance, an element of G1 - @param R ECP8 instance, an element of G2 - @param S ECP instance, an element of G1 - */ -extern void PAIR_ZZZ_double_ate(FP48_YYY *r,ECP8_ZZZ *P,ECP_ZZZ *Q,ECP8_ZZZ *R,ECP_ZZZ *S); -/** @brief Final exponentiation of pairing, converts output of Miller loop to element in GT - * - Here p is the internal modulus, and r is the group order - @param x FP48, on exit = x^((p^12-1)/r) - */ -extern void PAIR_ZZZ_fexp(FP48_YYY *x); -/** @brief Fast point multiplication of a member of the group G1 by a BIG number - * - May exploit endomorphism for speed. - @param Q ECP member of G1. - @param b BIG multiplier - - */ -extern void PAIR_ZZZ_G1mul(ECP_ZZZ *Q,BIG_XXX b); -/** @brief Fast point multiplication of a member of the group G2 by a BIG number - * - May exploit endomorphism for speed. - @param P ECP8 member of G1. - @param b BIG multiplier - - */ -extern void PAIR_ZZZ_G2mul(ECP8_ZZZ *P,BIG_XXX b); -/** @brief Fast raising of a member of GT to a BIG power - * - May exploit endomorphism for speed. - @param x FP48 member of GT. - @param b BIG exponent - - */ -extern void PAIR_ZZZ_GTpow(FP48_YYY *x,BIG_XXX b); -/** @brief Tests FP48 for membership of GT - * - @param x FP48 instance - @return 1 if x is in GT, else return 0 - - */ -extern int PAIR_ZZZ_GTmember(FP48_YYY *x); - - -#endif http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/pbc_support.c ---------------------------------------------------------------------- diff --git a/version3/c/pbc_support.c b/version3/c/pbc_support.c deleted file mode 100644 index 3639fb7..0000000 --- a/version3/c/pbc_support.c +++ /dev/null @@ -1,180 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -/* Symmetric crypto support functions Functions */ - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <time.h> - -#include "pbc_support.h" - -/* general purpose hash function w=hash(p|n|x|y) */ -void mhashit(int sha,int n,octet *x,octet *w) -{ - int i,c[4],hlen; - hash256 sha256; - hash512 sha512; - char hh[64]; - - switch (sha) - { - case SHA256: - HASH256_init(&sha256); - break; - case SHA384: - HASH384_init(&sha512); - break; - case SHA512: - HASH512_init(&sha512); - break; - } - - hlen=sha; - - if (n>0) - { - c[0]=(n>>24)&0xff; - c[1]=(n>>16)&0xff; - c[2]=(n>>8)&0xff; - c[3]=(n)&0xff; - for (i=0; i<4; i++) - { - switch(sha) - { - case SHA256: - HASH256_process(&sha256,c[i]); - break; - case SHA384: - HASH384_process(&sha512,c[i]); - break; - case SHA512: - HASH512_process(&sha512,c[i]); - break; - } - } - } - - if (x!=NULL) for (i=0; i<x->len; i++) - { - switch(sha) - { - case SHA256: - HASH256_process(&sha256,x->val[i]); - - break; - case SHA384: - HASH384_process(&sha512,x->val[i]); - break; - case SHA512: - HASH512_process(&sha512,x->val[i]); - break; - } - } - - for (i=0; i<hlen; i++) hh[i]=0; - switch (sha) - { - case SHA256: - HASH256_hash(&sha256,hh); - break; - case SHA384: - HASH384_hash(&sha512,hh); - break; - case SHA512: - HASH512_hash(&sha512,hh); - break; - } - - OCT_empty(w); - - if (hlen>=w->max) - OCT_jbytes(w,hh,w->max); - else - { - OCT_jbyte(w,0,w->max-hlen); - OCT_jbytes(w,hh,hlen); - -// OCT_jbytes(w,hh,hlen); -// OCT_jbyte(w,0,w->max-hlen); - } -} - -unsign32 today(void) -{ - /* return time in slots since epoch */ - unsign32 ti=(unsign32)time(NULL); - return (uint32_t)(ti/(60*TIME_SLOT_MINUTES)); -} - -/* Hash the M-Pin transcript - new */ - -void HASH_ALL(int sha,octet *HID,octet *xID,octet *xCID,octet *SEC,octet *Y,octet *R,octet *W,octet *H) -{ - char t[1284]; // assumes max modulus of 1024-bits - octet T= {0,sizeof(t),t}; - - OCT_joctet(&T,HID); - if (xCID!=NULL) OCT_joctet(&T,xCID); - else OCT_joctet(&T,xID); - OCT_joctet(&T,SEC); - OCT_joctet(&T,Y); - OCT_joctet(&T,R); - OCT_joctet(&T,W); - - mhashit(sha,0,&T,H); -} - -void HASH_ID(int sha,octet *ID,octet *HID) -{ - mhashit(sha,0,ID,HID); -} - -unsign32 GET_TIME(void) -{ - return (unsign32)time(NULL); -} - -/* AES-GCM Encryption of octets, K is key, H is header, - P is plaintext, C is ciphertext, T is authentication tag */ -void AES_GCM_ENCRYPT(octet *K,octet *IV,octet *H,octet *P,octet *C,octet *T) -{ - gcm g; - GCM_init(&g,K->len,K->val,IV->len,IV->val); - GCM_add_header(&g,H->val,H->len); - GCM_add_plain(&g,C->val,P->val,P->len); - C->len=P->len; - GCM_finish(&g,T->val); - T->len=16; -} - -/* AES-GCM Decryption of octets, K is key, H is header, - P is plaintext, C is ciphertext, T is authentication tag */ -void AES_GCM_DECRYPT(octet *K,octet *IV,octet *H,octet *C,octet *P,octet *T) -{ - gcm g; - GCM_init(&g,K->len,K->val,IV->len,IV->val); - GCM_add_header(&g,H->val,H->len); - GCM_add_cipher(&g,P->val,C->val,C->len); - P->len=C->len; - GCM_finish(&g,T->val); - T->len=16; -} - http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/pbc_support.h ---------------------------------------------------------------------- diff --git a/version3/c/pbc_support.h b/version3/c/pbc_support.h deleted file mode 100644 index 4fe82d9..0000000 --- a/version3/c/pbc_support.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -/** - * @file pbc_support.h - * @author Mike Scott - * @brief Auxiliary functions for Pairing-based protocols - * - * - */ - -#ifndef PBC_SUPPORT_H -#define PBC_SUPPORT_H - -#include "amcl.h" - -#define TIME_SLOT_MINUTES 1440 /**< Time Slot = 1 day */ - -/** @brief general purpose hash function w=hash(n|x) - * - @param sha is the hash type - @param n integer involved in the hash - @param x octect involved in the h ash - @param w output - */ -extern void mhashit(int sha,int n,octet *x,octet *w); - -/** @brief Supply today's date as days from the epoch - * - @return today's date, as number of days elapsed since the epoch - */ -unsign32 today(void); -/** @brief Hash the session transcript - @param h is the hash type - @param I is the hashed input client ID = H(ID) - @param U is the client output = x.H(ID) - @param CU is the client output = x.(H(ID)+H(T|H(ID))) - @param Y is the server challenge - @param V is the client part response - @param R is the client part response - @param W is the server part response - @param H the output is the hash of all of the above that apply -*/ -void HASH_ALL(int h,octet *I,octet *U,octet *CU,octet *Y,octet *V,octet *R,octet *W,octet *H); -/** @brief Hash an M-Pin Identity to an octet string - * - @param h is the hash type - @param ID an octet containing the identity - @param HID an octet containing the hashed identity - */ -void HASH_ID(int h,octet *ID,octet *HID); -/** @brief Get epoch time as unsigned integer - * - @return current epoch time in seconds - */ -unsign32 GET_TIME(void); -/** @brief AES-GCM Encryption - * - @param K AES key - @param IV Initialization vector - @param H Header - @param P Plaintext - @param C Ciphertext - @param T Checksum - */ -void AES_GCM_ENCRYPT(octet *K,octet *IV,octet *H,octet *P,octet *C,octet *T); - -/** @brief AES-GCM Decryption - * - @param K AES key - @param IV Initialization vector - @param H Header - @param P Plaintext - @param C Ciphertext - @param T Checksum - */ -void AES_GCM_DECRYPT(octet *K,octet *IV,octet *H,octet *C,octet *P,octet *T); - - -#endif http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rand.c ---------------------------------------------------------------------- diff --git a/version3/c/rand.c b/version3/c/rand.c deleted file mode 100644 index 4a2cd0a..0000000 --- a/version3/c/rand.c +++ /dev/null @@ -1,172 +0,0 @@ -/* -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. -*/ - -/* - * Cryptographic strong random number generator - * - * Unguessable seed -> SHA -> PRNG internal state -> SHA -> random numbers - * Slow - but secure - * - * See ftp://ftp.rsasecurity.com/pub/pdfs/bull-1.pdf for a justification - */ -/* SU=m, m is Stack Usage */ - -#include "amcl.h" - -/* SU= 20 */ -static unsign32 sbrand(csprng *rng) -{ - /* Marsaglia & Zaman random number generator */ - int i,k; - unsign32 pdiff,t; - rng->rndptr++; - if (rng->rndptr<NK) return rng->ira[rng->rndptr]; - rng->rndptr=0; - for (i=0,k=NK-NJ; i<NK; i++,k++) - { - /* calculate next NK values */ - if (k==NK) k=0; - t=rng->ira[k]; - pdiff=t - rng->ira[i] - rng->borrow; - - if (pdiff<t) rng->borrow=0; - if (pdiff>t) rng->borrow=1; - rng->ira[i]=pdiff; - } - return rng->ira[0]; -} - -/* SU= 20 */ -static void sirand(csprng* rng,unsign32 seed) -{ - /* initialise random number system */ - /* modified so that a subsequent call "stirs" in another seed value */ - /* in this way as many seed bits as desired may be used */ - int i,in; - unsign32 t,m=1; - rng->borrow=0L; - rng->rndptr=0; - rng->ira[0]^=seed; - for (i=1; i<NK; i++) - { - /* fill initialisation vector */ - in=(NV*i)%NK; - rng->ira[in]^=m; /* note XOR */ - t=m; - m=seed-m; - seed=t; - } - for (i=0; i<10000; i++) sbrand(rng ); /* "warm-up" & stir the generator */ -} - -/* SU= 312 */ -static void fill_pool(csprng *rng) -{ - /* hash down output of RNG to re-fill the pool */ - int i; - hash256 sh; - HASH256_init(&sh); - for (i=0; i<128; i++) HASH256_process(&sh,sbrand(rng)); - HASH256_hash(&sh,rng->pool); - rng->pool_ptr=0; -} - -static unsign32 pack(const uchar *b) -{ - /* pack bytes into a 32-bit Word */ - return ((unsign32)b[3]<<24)|((unsign32)b[2]<<16)|((unsign32)b[1]<<8)|(unsign32)b[0]; -} - -/* SU= 360 */ -/* Initialize RNG with some real entropy from some external source */ -void RAND_seed(csprng *rng,int rawlen,char *raw) -{ - /* initialise from at least 128 byte string of raw * - * random (keyboard?) input, and 32-bit time-of-day */ - int i; - char digest[32]; - uchar b[4]; - hash256 sh; - rng->pool_ptr=0; - for (i=0; i<NK; i++) rng->ira[i]=0; - if (rawlen>0) - { - HASH256_init(&sh); - for (i=0; i<rawlen; i++) - HASH256_process(&sh,raw[i]); - HASH256_hash(&sh,digest); - - /* initialise PRNG from distilled randomness */ - - for (i=0; i<8; i++) - { - b[0]=digest[4*i]; - b[1]=digest[4*i+1]; - b[2]=digest[4*i+2]; - b[3]=digest[4*i+3]; - // printf("%08x\n",pack(b)); - sirand(rng,pack(b)); - } - } - fill_pool(rng); -} - -/* Terminate and clean up */ -void RAND_clean(csprng *rng) -{ - /* kill internal state */ - int i; - rng->pool_ptr=rng->rndptr=0; - for (i=0; i<32; i++) rng->pool[i]=0; - for (i=0; i<NK; i++) rng->ira[i]=0; - rng->borrow=0; -} - -/* get random byte */ -/* SU= 8 */ -int RAND_byte(csprng *rng) -{ - int r; - r=rng->pool[rng->pool_ptr++]; - if (rng->pool_ptr>=32) fill_pool(rng); - return (r&0xff); -} - -/* test main program */ -/* -#include <stdio.h> -#include <string.h> - -void main() -{ - int i; - char raw[256]; - csprng rng; - - RAND_clean(&rng); - - - for (i=0;i<256;i++) raw[i]=(char)i; - RAND_seed(&rng,256,raw); - - for (i=0;i<1000;i++) - printf("%02x ",(unsigned char)RAND_byte(&rng)); -} - -*/ http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/randapi.c ---------------------------------------------------------------------- diff --git a/version3/c/randapi.c b/version3/c/randapi.c deleted file mode 100644 index 9b32efb..0000000 --- a/version3/c/randapi.c +++ /dev/null @@ -1,15 +0,0 @@ -#include "randapi.h" - -/* Initialise a Cryptographically Strong Random Number Generator from - an octet of raw random data */ - -void CREATE_CSPRNG(csprng *RNG,octet *RAW) -{ - RAND_seed(RNG,RAW->len,RAW->val); -} - -void KILL_CSPRNG(csprng *RNG) -{ - RAND_clean(RNG); -} - http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/randapi.h ---------------------------------------------------------------------- diff --git a/version3/c/randapi.h b/version3/c/randapi.h deleted file mode 100644 index 9a6807e..0000000 --- a/version3/c/randapi.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -/** - * @file randapi.h - * @author Mike Scott - * @brief PRNG API File - * - */ - -#ifndef RANDOM_H -#define RANDOM_H - -#include "amcl.h" - -/** @brief Initialise a random number generator - * - @param R is a pointer to a cryptographically secure random number generator - @param S is an input truly random seed value - */ -extern void CREATE_CSPRNG(csprng *R,octet *S); -/** @brief Kill a random number generator - * - Deletes all internal state - @param R is a pointer to a cryptographically secure random number generator - */ -extern void KILL_CSPRNG(csprng *R); - -#endif - http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/readme.txt ---------------------------------------------------------------------- diff --git a/version3/c/readme.txt b/version3/c/readme.txt deleted file mode 100644 index 3d0dc01..0000000 --- a/version3/c/readme.txt +++ /dev/null @@ -1,75 +0,0 @@ -Namespaces are sinulated to separate different curves. - -To this end the BIG type is renamed to BIG_XXX, where XXX can be changed to -describe the size and layout of the BIG variable. Similarily the FP type -is renamed FP_YYY, where YYY reflects the modulus used. Also the ECP type -is renamed ECP_ZZZ, where ZZZ describes the actual curve. Function names -are also decorated in the same way. - -So for example to support both ED25519 and the NIST P256 curve on a 64-bit -processor, we would need to create BIG_256_56, FP_25519, ECP_ED25519 and -BIG_256_56, FP_NIST256, ECP_NIST256. Note that both curves could be built -on top of BIG_256_56, as both require support for 256-bit numbers using -an internal number base of 2^56. - -Separate ROM files provide the constants required for each curve. The -associated header files (big.h, fp.h and ecp.h) also specify -certain constants that must be set for the particular curve. - --------------------------------------- - -To build the library and see it in action, copy all of the files in this -directory to a fresh directory. Then execute the python3 script config32.py -for a 32-bit build, or config64.py for a 64-bit build, and select the curves -that you wish to support. Note that support for 16-bit builds is currently -somewhat limited - see config16.py. A library is built automatically -including all of the modules that you will need. - -The configuration files assume the gcc compiler. For clang edit the -config32.py and config64.py files and substitute "clang" for "gcc". -Note that clang is about 10-15% faster.* - -NOTE: In the file config_curve.h a couple of methods with possible IP issues -are commented out. For faster pairing code, edit this file. - -As a quick example execute - -py config32.py - -or - -python3 config32.py - -Then select options 1, 3, 7, 18, 20, 25, 26 and 27, which are fixed for the example -program. (For a 16-bit build select 1,3 and 5). Select 0 then to exit. - -Then compile - -gcc -O2 -std=c99 testall.c amcl.a -o testall.exe - -if using MINGW in Windows. Or for Linux - -gcc -O2 -std=c99 testall.c amcl.a -o testall - -The test program exercises 3 different ordinary elliptic curves, a -pairing friendly curve and RSA, all in the one binary. - -The correct PIN is 1234 - - -Next compile - - -gcc -O2 -std=c99 benchtest_all.c amcl.a -o benchtest_all.exe - -if using MINGW in Windows. Or for Linux - -gcc -O2 -std=c99 benchtest_all.c amcl.a -o benchtest_all - -This program provides some timings. - -*Using clang on Windows -Download latest clang from http://releases.llvm.org/download.html -Choose Clang for Windows (64-bit) (.sig) -Install a free version of Microsoft Visual C++ https://www.visualstudio.com/downloads/ -Now use "clang" wherever "gcc" was used before. http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_ANSSI.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_ANSSI.c b/version3/c/rom_curve_ANSSI.c deleted file mode 100644 index 535a697..0000000 --- a/version3/c/rom_curve_ANSSI.c +++ /dev/null @@ -1,33 +0,0 @@ -#include "arch.h" -#include "ecp_ANSSI.h" - -/* ANSSI Curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 -const int CURVE_Cof_I_ANNSI= 1; -const BIG_256_28 CURVE_Cof_ANSSI= {0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_A_ANSSI= -3; -const int CURVE_B_I_ANSSI= 0; -const BIG_256_28 CURVE_B_ANSSI= {0xB7BB73F,0x75ED967,0x1A18030,0xC9AE4B,0xFDFEC,0x754A44C,0xD4ABA,0x5428A93,0xE353FCA,0xE}; -const BIG_256_28 CURVE_Order_ANSSI= {0x6D655E1,0xFDD459C,0x2BF941F,0x67E140D,0x35B53DC,0xE8CE424,0xF10126D,0xB3AD58,0x1FD178C,0xF}; -const BIG_256_28 CURVE_Gx_ANSSI= {0x98F5CFF,0xC97A2DD,0x8B70164,0xD2DCAF9,0x3958C27,0x4749D42,0xB31183D,0x56C139E,0x6B3D4C3,0xB}; -const BIG_256_28 CURVE_Gy_ANSSI= {0x4062CFB,0x115A155,0x4C9E183,0xC307E8E,0xF8C2701,0xF0F3ECE,0x11F9271,0xC8B2049,0x142E0F7,0x6}; -#endif - -#if CHUNK==64 -const int CURVE_Cof_I_ANNSI= 1; -const BIG_256_56 CURVE_Cof_ANSSI= {0x1L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_A_ANSSI= -3; -const int CURVE_B_I_ANSSI= 0; -const BIG_256_56 CURVE_B_ANSSI= {0x75ED967B7BB73FL,0xC9AE4B1A18030L,0x754A44C00FDFECL,0x5428A9300D4ABAL,0xEE353FCAL}; -const BIG_256_56 CURVE_Order_ANSSI= {0xFDD459C6D655E1L,0x67E140D2BF941FL,0xE8CE42435B53DCL,0xB3AD58F10126DL,0xF1FD178CL}; -const BIG_256_56 CURVE_Gx_ANSSI= {0xC97A2DD98F5CFFL,0xD2DCAF98B70164L,0x4749D423958C27L,0x56C139EB31183DL,0xB6B3D4C3L}; -const BIG_256_56 CURVE_Gy_ANSSI= {0x115A1554062CFBL,0xC307E8E4C9E183L,0xF0F3ECEF8C2701L,0xC8B204911F9271L,0x6142E0F7L}; -#endif - http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_BLS24.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_BLS24.c b/version3/c/rom_curve_BLS24.c deleted file mode 100644 index 6f55314..0000000 --- a/version3/c/rom_curve_BLS24.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "arch.h" -#include "ecp_BLS24.h" - -/* Curve BLS24 - Pairing friendly BLS24 curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 -// Base Bits= 29 - -const int CURVE_Cof_I_BLS24= 0; -const int CURVE_A_BLS24= 0; -const int CURVE_B_I_BLS24= 19; -const BIG_480_29 CURVE_B_BLS24= {0x13,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_480_29 CURVE_Order_BLS24= {0x10000001,0xD047FF,0x1FD54464,0x1E3CE067,0xE322DDA,0x1D356F3F,0x7433B44,0x49091F9,0x1729CC2,0x250286C,0x16E62ED,0xB403E1E,0x1001000,0x80,0x0,0x0,0x0}; -const BIG_480_29 CURVE_Gx_BLS24= {0xBE3CCD4,0x33B07AF,0x1B67D159,0x3DFC5B5,0xEBA1FCC,0x1A3C1F84,0x56BE204,0xEF8DF1B,0x11AE2D84,0x5FEE546,0x161B3BF9,0x183B20EE,0x1EA5D99B,0x14F0C5BF,0xBE521B7,0x17C682F9,0x1AB2}; -const BIG_480_29 CURVE_Gy_BLS24= {0x121E5245,0x65D2E56,0x11577DB1,0x16DACC11,0x14F39746,0x459F694,0x12483FCF,0xC828B04,0xFD63E5A,0x7B1D52,0xAFDE738,0xF349254,0x1A4529FF,0x10E53353,0xF91DEE1,0x16E18D8A,0x47FC}; - -const BIG_480_29 CURVE_Bnx_BLS24= {0x11FF80,0x80010,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_480_29 CURVE_Cof_BLS24= {0x19F415AB,0x1E0FFDFF,0x15AAADFF,0xAA,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_480_29 CURVE_Cru_BLS24= {0xDD794A9,0x1DE138A3,0x2BCCE90,0xC746127,0x15223DDC,0x1DD8890B,0xED08DB7,0xE24B9F,0xE379CE6,0x37011AC,0x11BAC820,0x1EEFAD01,0x200860F,0x147218A6,0xF16A209,0xF0079,0x555C}; -const BIG_480_29 CURVE_Pxaa_BLS24= {0x14E24678,0x1F149A9B,0x9609022,0x1C186868,0xCDEFC69,0x1C87BB2E,0x14A2235F,0x7586755,0x5896747,0x159BFE92,0x3B5572E,0x1710A521,0x71EB14A,0xC643C33,0x12581DE5,0x1BCA747D,0x959}; -const BIG_480_29 CURVE_Pxab_BLS24= {0x1FB099B8,0x3FCF5D7,0x4A91C0E,0xC6EEB40,0x11FC2385,0x11B5AE8D,0x1A9CC3E7,0x194FE144,0x185DB2A5,0x930E1C7,0x14F85F9A,0x1F2ED4E,0x1D1BE5AD,0xF26169C,0xCF7F194,0x1DA1062E,0x3B0D}; -const BIG_480_29 CURVE_Pxba_BLS24= {0x11AD15D3,0xD0E6F38,0x17DB85BB,0x30A62F1,0x1EA3E09A,0x17B25FA1,0x1B7959AC,0x1165B19A,0x6C74FDB,0x18F790E1,0x12278FDA,0x1E008F79,0x103F329,0x14619FF1,0x1EBCAA8,0xFF5A9CA,0x3EC2}; -const BIG_480_29 CURVE_Pxbb_BLS24= {0x1EE0F480,0x3D5943A,0xF5B12E3,0x128AADC8,0x180E1CB9,0x1EFD916F,0x48BC7F,0x1D5EE1FA,0x5698EF5,0x11D6AED9,0x1386BC6E,0x196E900B,0x1CE2E465,0xC2A8ED3,0x1E67DF99,0x71B7940,0xA5B}; -const BIG_480_29 CURVE_Pyaa_BLS24= {0x14781AA0,0xC324C98,0xEDC2AC,0x16C13B46,0x145FC44B,0x12529530,0x1310A8C4,0x1768C5C0,0xE19AE68,0x56E1C1D,0x13DAF93F,0x17E94366,0xF901AD0,0x76800CC,0x10250D8B,0x1E6BAE6D,0x5057}; -const BIG_480_29 CURVE_Pyab_BLS24= {0xEAE08FA,0xDDF62BF,0xA97E5AB,0xF0EE97,0x99A42CA,0x1C326578,0xF33DC11,0x8B913F7,0xFEF8552,0x19F35B90,0x58DDBDE,0xFC32FF2,0x1587B5DF,0xB5EB07A,0x1A258DE0,0x1692CC3D,0x2CE2}; -const BIG_480_29 CURVE_Pyba_BLS24= {0x5F0CC41,0xB9813B5,0x14C2A87D,0xFF1264A,0x19AF8A14,0x6CE6C3,0x2A7F8A2,0x121DCA7D,0x7D37153,0x19D21078,0x15466DC7,0x1362982B,0x1DD3CB5B,0x1CFC0D1C,0x18C69AF8,0x8CC7DC,0x1807}; -const BIG_480_29 CURVE_Pybb_BLS24= {0x115C1CAE,0x78D9732,0x16C26237,0x5A81A6A,0x1C38A777,0x56121FE,0x4DAD9D7,0x1BEBA670,0xA1D72FC,0xD60B274,0x19734258,0x1D621775,0x4691771,0x14206B68,0x17B22DE4,0x29D5B37,0x499D}; -const BIG_480_29 CURVE_W_BLS24[2]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0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x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0 ,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -#endif - -#if CHUNK==64 -// Base Bits= 56 - -const int CURVE_Cof_I_BLS24= 0; -const int CURVE_A_BLS24= 0; -const int CURVE_B_I_BLS24= 19; -const BIG_480_56 CURVE_B_BLS24= {0x13L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_480_56 CURVE_Order_BLS24= {0x1A08FFF0000001L,0x1E7033FF551190L,0x6ADE7EE322DDAFL,0x848FC9D0CED13AL,0x50D81729CC224L,0x1F0F05B98BB44AL,0x10010010005A0L,0x0L,0x0L}; -const BIG_480_56 CURVE_Gx_BLS24= {0x6760F5EBE3CCD4L,0xEFE2DAED9F4564L,0x783F08EBA1FCC1L,0xC6F8D95AF88134L,0xDCA8D1AE2D8477L,0x9077586CEFE4BFL,0x8B7FEA5D99BC1DL,0x17CAF9486DE9E1L,0x1AB2BE34L}; -const BIG_480_56 CURVE_Gy_BLS24= {0xCBA5CAD21E5245L,0x6D6608C55DF6C4L,0xB3ED294F39746BL,0x145824920FF3C8L,0x63AA4FD63E5A64L,0x492A2BF79CE00FL,0x66A7A4529FF79AL,0x6C53E477B861CAL,0x47FCB70CL}; - -const BIG_480_56 CURVE_Bnx_BLS24= {0x100020011FF80L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_480_56 CURVE_Cof_BLS24= {0xC1FFBFF9F415ABL,0x5556AAB7FFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_480_56 CURVE_Cru_BLS24= {0xBC27146DD794A9L,0x3A30938AF33A43L,0xB112175223DDC6L,0x125CFBB4236DFBL,0x2358E379CE607L,0xD680C6EB20806EL,0x314C200860FF77L,0x3CBC5A88268E4L,0x555C0078L}; -const BIG_480_56 CURVE_Pxaa_BLS24= {0xE2935374E24678L,0xC34342582408BL,0xF765CCDEFC69EL,0xC33AAD2888D7F9L,0x7FD2458967473AL,0x52908ED55CBAB3L,0x786671EB14AB88L,0xA3EC96077958C8L,0x959DE53L}; -const BIG_480_56 CURVE_Pxab_BLS24= {0x7F9EBAFFB099B8L,0x3775A012A47038L,0x6B5D1B1FC23856L,0x7F0A26A730F9E3L,0x1C38F85DB2A5CAL,0x76A753E17E6926L,0x2D39D1BE5AD0F9L,0x31733DFC651E4CL,0x3B0DED08L}; -const BIG_480_56 CURVE_Pxba_BLS24= {0xA1CDE711AD15D3L,0x853178DF6E16EDL,0x64BF43EA3E09A1L,0x2D8CD6DE566B2FL,0xF21C26C74FDB8BL,0x47BCC89E3F6B1EL,0x3FE2103F329F00L,0x4E507AF2AA28C3L,0x3EC27FADL}; -const BIG_480_56 CURVE_Pxbb_BLS24= {0x7AB2875EE0F480L,0x4556E43D6C4B8CL,0xFB22DF80E1CB99L,0xF70FD0122F1FFDL,0xD5DB25698EF5EAL,0x4805CE1AF1BA3AL,0x1DA7CE2E465CB7L,0xCA0799F7E65855L,0xA5B38DBL}; -const BIG_480_56 CURVE_Pyaa_BLS24= {0x86499314781AA0L,0x609DA303B70AB1L,0xA52A6145FC44BBL,0x462E04C42A3124L,0xC383AE19AE68BBL,0xA1B34F6BE4FCADL,0x198F901AD0BF4L,0x736C094362CED0L,0x5057F35DL}; -const BIG_480_56 CURVE_Pyab_BLS24= {0xBBEC57EEAE08FAL,0x78774BAA5F96ADL,0x64CAF099A42CA0L,0xC89FBBCCF70478L,0x6B720FEF855245L,0x97F916376F7B3EL,0x60F5587B5DF7E1L,0x61EE89637816BDL,0x2CE2B496L}; -const BIG_480_56 CURVE_Pyba_BLS24= {0x730276A5F0CC41L,0xF89325530AA1F5L,0xD9CD879AF8A147L,0xEE53E8A9FE2880L,0x420F07D3715390L,0x4C15D519B71F3AL,0x1A39DD3CB5B9B1L,0x3EE631A6BE39F8L,0x18070466L}; -const BIG_480_56 CURVE_Pybb_BLS24= {0xF1B2E6515C1CAEL,0xD40D355B0988DCL,0xC243FDC38A7772L,0x5D338136B675CAL,0x164E8A1D72FCDFL,0xBBAE5CD0961ACL,0xD6D04691771EB1L,0xD9BDEC8B792840L,0x499D14EAL}; -const BIG_480_56 CURVE_W_BLS24[2]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_480_56 CURVE_SB_BLS24[2][2]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,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L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; - -#endif \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_BLS381.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_BLS381.c b/version3/c/rom_curve_BLS381.c deleted file mode 100644 index c4f019e..0000000 --- a/version3/c/rom_curve_BLS381.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "arch.h" -#include "ecp_BLS381.h" - -/* Curve BLS381 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -const int CURVE_Cof_I_BLS381= 0; -const int CURVE_A_BLS381= 0; -const int CURVE_B_I_BLS381= 4; -const BIG_384_29 CURVE_B_BLS381= {0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Order_BLS381= {0x1,0x1FFFFFF8,0x1F96FFBF,0x1B4805FF,0x1D80553B,0xC0404D0,0x1520CCE7,0xA6533AF,0x73EDA7,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Gx_BLS381= {0x1B22C6BB,0x19D78056,0x1E86BBFE,0xBD07FF2,0x1AC586C5,0x1D1F8B8D,0x4168538,0x9F2EE97,0xFC3688C,0x27D4D60,0x9A558E3,0x32FAF28,0x1F1D3A73,0xB}; -const BIG_384_29 CURVE_Gy_BLS381= {0x6C5E7E1,0x551194A,0x222B903,0x198E8945,0xB3EDD03,0xC659602,0xBD8036C,0x12BABA01,0x4FCF5E0,0xBA0EC57,0x8278C3B,0x75541E3,0xB3F481E,0x4}; - - -const BIG_384_29 CURVE_Bnx_BLS381= {0x10000,0x10080000,0x34,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Cof_BLS381= {0xAAAB,0x55558,0x157855A3,0x191800AA,0x396,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Cru_BLS381= {0x1FFEFFFE,0x100FFFFF,0x280008B,0xFB026C4,0x9688DE1,0x149DF37C,0x1FAB76CE,0xED41EE,0x11BA69C6,0x1EFBB672,0x17C659CB,0x0,0x0,0x0}; - -const BIG_384_29 CURVE_Pxa_BLS381= {0x121BDB8,0x402B646,0x16EFBF5,0x18064D50,0x1D1770BA,0x5B23D71,0xC0AD144,0x1A9F4807,0x11C6E47A,0x196E2882,0x9820149,0x11E1522,0x4AA2B2F,0x1}; -const BIG_384_29 CURVE_Pxb_BLS381= {0x1D042B7E,0xD63E82A,0x51755F9,0x19E22427,0x15049334,0x10DDEE3F,0x186AD769,0x1A132416,0x5596BD0,0x4413A7B,0x1F6B34E8,0x4E33EC0,0x1E02B605,0x9}; -const BIG_384_29 CURVE_Pya_BLS381= {0x8B82801,0xC9AA430,0xB28A278,0x15939877,0xD12C923,0xD34A8B0,0xE9DB50A,0x155197BA,0x1AADFD9B,0x16D171A8,0x3327371,0x4FADC23,0xE5D5277,0x6}; -const BIG_384_29 CURVE_Pyb_BLS381= {0x105F79BE,0x15483AFF,0x1B07686A,0xE1A4EB9,0x99AB3F3,0x955AB97,0xEBC99D2,0xFD0B4EC,0x19CB3E28,0x15E145C,0xCAB34AC,0x1D4E6998,0x6C4A02,0x3}; -const BIG_384_29 CURVE_W_BLS381[2]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG_384_29 CURVE_SB_BLS381[2][2]= {{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0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0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - - -#endif - -#if CHUNK==64 - -const int CURVE_Cof_I_BLS381= 0; -const int CURVE_A_BLS381= 0; -const int CURVE_B_I_BLS381= 4; -const BIG_384_58 CURVE_B_BLS381= {0x4L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_384_58 CURVE_Order_BLS381= {0x3FFFFFF00000001L,0x36900BFFF96FFBFL,0x180809A1D80553BL,0x14CA675F520CCE7L,0x73EDA7L,0x0L,0x0L}; -const BIG_384_58 CURVE_Gx_BLS381= {0x33AF00ADB22C6BBL,0x17A0FFE5E86BBFEL,0x3A3F171BAC586C5L,0x13E5DD2E4168538L,0x4FA9AC0FC3688CL,0x65F5E509A558E3L,0x17F1D3A73L}; -const BIG_384_58 CURVE_Gy_BLS381= {0xAA232946C5E7E1L,0x331D128A222B903L,0x18CB2C04B3EDD03L,0x25757402BD8036CL,0x1741D8AE4FCF5E0L,0xEAA83C68278C3BL,0x8B3F481EL}; - -const BIG_384_58 CURVE_Bnx_BLS381= {0x201000000010000L,0x34L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_384_58 CURVE_Cof_BLS381= {0xAAAB0000AAABL,0x3230015557855A3L,0x396L,0x0L,0x0L,0x0L,0x0L}; -const BIG_384_58 CURVE_Cru_BLS381= {0x201FFFFFFFEFFFEL,0x1F604D88280008BL,0x293BE6F89688DE1L,0x1DA83DDFAB76CEL,0x3DF76CE51BA69C6L,0x17C659CBL,0x0L}; - -const BIG_384_58 CURVE_Pxa_BLS381= {0x8056C8C121BDB8L,0x300C9AA016EFBF5L,0xB647AE3D1770BAL,0x353E900EC0AD144L,0x32DC51051C6E47AL,0x23C2A449820149L,0x24AA2B2FL}; -const BIG_384_58 CURVE_Pxb_BLS381= {0x1AC7D055D042B7EL,0x33C4484E51755F9L,0x21BBDC7F5049334L,0x3426482D86AD769L,0x88274F65596BD0L,0x9C67D81F6B34E8L,0x13E02B605L}; -const BIG_384_58 CURVE_Pya_BLS381= {0x193548608B82801L,0x2B2730EEB28A278L,0x1A695160D12C923L,0x2AA32F74E9DB50AL,0x2DA2E351AADFD9BL,0x9F5B8463327371L,0xCE5D5277L}; -const BIG_384_58 CURVE_Pyb_BLS381= {0x2A9075FF05F79BEL,0x1C349D73B07686AL,0x12AB572E99AB3F3L,0x1FA169D8EBC99D2L,0x2BC28B99CB3E28L,0x3A9CD330CAB34ACL,0x606C4A02L}; -const BIG_384_58 CURVE_W_BLS381[2]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_384_58 CURVE_SB_BLS381[2][2]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; -const BIG_384_58 CURVE_WB_BLS381[4]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_384_58 CURVE_BB_BLS381[4][4]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; - -#endif http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_BLS383.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_BLS383.c b/version3/c/rom_curve_BLS383.c deleted file mode 100644 index 9b870e6..0000000 --- a/version3/c/rom_curve_BLS383.c +++ /dev/null @@ -1,62 +0,0 @@ -#include "arch.h" -#include "ecp_BLS383.h" - -/* Curve BLS383 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -// Base Bits= 29 - -const int CURVE_A_BLS383= 0; -const int CURVE_Cof_I_BLS383= 0; -const BIG_384_29 CURVE_Cof_BLS383= {0x15169EAB,0xA82AB0A,0xAAEFFED,0x15558001,0x555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const int CURVE_B_I_BLS383= 15; -const BIG_384_29 CURVE_B_BLS383= {0xF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Order_BLS383= {0x1EBC0001,0x1904CF5F,0x834E5CE,0xBE12B42,0xB381DE0,0xE40B4C,0x270110,0x10018017,0x1002001,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Gx_BLS383= {0x8734573,0x623B9C8,0x1D1DC11E,0xBB7E107,0x1E3445C5,0x1D6C2578,0x10B0BE1E,0xED6103E,0x10F31D9F,0x296ED82,0x18E0D7D0,0x12F3D9C9,0x1FCBA55B,0x20}; -const BIG_384_29 CURVE_Gy_BLS383= {0x3F224,0x968B2F4,0x1FE63F48,0xFA93D90,0x14D2DDE5,0x54A56F5,0x12441D4C,0x18CD76C8,0x199D0DAD,0xE18E236,0x92BA73,0x99F6600,0x8F16727,0x3}; - -const BIG_384_29 CURVE_Bnx_BLS383= {0x1001200,0x400000,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_384_29 CURVE_Cru_BLS383= {0xEAAC2A9,0x61B3A81,0x17D974B7,0xBED0345,0xA341BC2,0x17A51A6F,0x5738948,0x69B7BAE,0x14605445,0x374A43,0x8116AD1,0x956DD69,0x16556956,0x2A}; -const BIG_384_29 CURVE_Pxa_BLS383= {0xD7F2D86,0x1E59DB1,0x17474F85,0x1FB56CF2,0x572EE81,0xE487AB1,0x96F51FC,0x190A5AAE,0x6432501,0x13E58F3A,0x101E6425,0xFD807D1,0x34D2240,0x3}; -const BIG_384_29 CURVE_Pxb_BLS383= {0x452DE15,0x1ECF20F6,0x1FF9837B,0x95651AA,0xD5D75B5,0x5D44749,0x12277F66,0x1DB3A0B9,0x1D24F498,0x19441B0E,0x1CDE9DC5,0x2C975,0xD78006,0x18}; -const BIG_384_29 CURVE_Pya_BLS383= {0x1408CB41,0x34785DC,0x3586597,0x13DBC9E4,0x1A2E75B4,0x1D65489,0xCF9A25E,0x1ACE7933,0x1B6E990E,0x19FF31A3,0x12527615,0x1A44A68F,0x1792CF93,0x19}; -const BIG_384_29 CURVE_Pyb_BLS383= {0x1F479093,0x16C2321B,0x1889218E,0x87961BC,0x1BC98B01,0x197A24FB,0xA3DEBC2,0x88D67DF,0x1CE0D,0x1E8AD3D7,0x93B9EE9,0x59B18D6,0xE5247DD,0x10}; -const BIG_384_29 CURVE_W_BLS383[2]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG_384_29 CURVE_SB_BLS383[2][2]= {{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; -const BIG_384_29 CURVE_WB_BLS383[4]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG_384_29 CURVE_BB_BLS383[4][4]= {{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - -#endif - -#if CHUNK==64 - -// Base Bits= 58 - -const int CURVE_A_BLS383= 0; -const int CURVE_Cof_I_BLS383= 0; -const BIG_384_58 CURVE_Cof_BLS383= {0x150556155169EABL,0x2AAB0002AAEFFEDL,0x555L,0x0L,0x0L,0x0L,0x0L}; -const int CURVE_B_I_BLS383= 15; -const BIG_384_58 CURVE_B_BLS383= {0xFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_384_58 CURVE_Order_BLS383= {0x32099EBFEBC0001L,0x17C25684834E5CEL,0x1C81698B381DE0L,0x2003002E0270110L,0x1002001L,0x0L,0x0L}; -const BIG_384_58 CURVE_Gx_BLS383= {0xC4773908734573L,0x176FC20FD1DC11EL,0x3AD84AF1E3445C5L,0x1DAC207D0B0BE1EL,0x52DDB050F31D9FL,0x25E7B3938E0D7D0L,0x41FCBA55BL}; -const BIG_384_58 CURVE_Gy_BLS383= {0x12D165E8003F224L,0x1F527B21FE63F48L,0xA94ADEB4D2DDE5L,0x319AED912441D4CL,0x1C31C46D99D0DADL,0x133ECC00092BA73L,0x68F16727L}; - -const BIG_384_58 CURVE_Bnx_BLS383= {0x8000001001200L,0x40L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_384_58 CURVE_Cru_BLS383= {0xC367502EAAC2A9L,0x17DA068B7D974B7L,0x2F4A34DEA341BC2L,0xD36F75C5738948L,0x6E94874605445L,0x12ADBAD28116AD1L,0x556556956L}; -const BIG_384_58 CURVE_Pxa_BLS383= {0x3CB3B62D7F2D86L,0x3F6AD9E57474F85L,0x1C90F562572EE81L,0x3214B55C96F51FCL,0x27CB1E746432501L,0x1FB00FA301E6425L,0x634D2240L}; -const BIG_384_58 CURVE_Pxb_BLS383= {0x3D9E41EC452DE15L,0x12ACA355FF9837BL,0xBA88E92D5D75B5L,0x3B6741732277F66L,0x3288361DD24F498L,0x592EBCDE9DC5L,0x300D78006L}; -const BIG_384_58 CURVE_Pya_BLS383= {0x68F0BB9408CB41L,0x27B793C83586597L,0x3ACA913A2E75B4L,0x359CF266CF9A25EL,0x33FE6347B6E990EL,0x34894D1F2527615L,0x33792CF93L}; -const BIG_384_58 CURVE_Pyb_BLS383= {0x2D846437F479093L,0x10F2C379889218EL,0x32F449F7BC98B01L,0x111ACFBEA3DEBC2L,0x3D15A7AE001CE0DL,0xB3631AC93B9EE9L,0x20E5247DDL}; -const BIG_384_58 CURVE_W_BLS383[2]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_384_58 CURVE_SB_BLS383[2][2]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; -const BIG_384_58 CURVE_WB_BLS383[4]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_384_58 CURVE_BB_BLS383[4][4]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; - -#endif \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_BLS461.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_BLS461.c b/version3/c/rom_curve_BLS461.c deleted file mode 100644 index 37180e7..0000000 --- a/version3/c/rom_curve_BLS461.c +++ /dev/null @@ -1,59 +0,0 @@ -#include "arch.h" -#include "ecp_BLS461.h" - -/* Curve BLS383 - Pairing friendly BLS curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -const int CURVE_Cof_I_BLS461= 0; -const int CURVE_A_BLS461= 0; -const int CURVE_B_I_BLS461= 9; -const BIG_464_28 CURVE_B_BLS461= {0x9,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_464_28 CURVE_Order_BLS461= {0x1,0x0,0xFFFFC00,0x7FEFFFE,0x110000,0x7FFC800,0x801FC01,0x5FD000E,0x17FE0,0xFFFC018,0xFFFFFF7,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_464_28 CURVE_Gx_BLS461= {0xADEE93D,0x4D026A8,0x74B7411,0xD9C00EE,0x31AC7F2,0xC3981B5,0x9218229,0xD3564DC,0xA096650,0x6F7C292,0x9743616,0xBE922B1,0x12CF668,0xC81327,0x463B73A,0xE74E99B,0xAD0}; -const BIG_464_28 CURVE_Gy_BLS461= {0xAD1D465,0xF763157,0xC4FF470,0x17884C8,0xB8D215D,0xA819E66,0xF4959D0,0xE5C3245,0xB84910A,0xB8BFA40,0xBE96EEC,0x8BF9F8C,0xF277ACC,0x5F1C3F2,0x5F68C9,0xCDB14B3,0x77B}; - -const BIG_464_28 CURVE_Bnx_BLS461= {0x0,0xFBFFFE0,0x1FFFFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_464_28 CURVE_Cof_BLS461= {0xAAAAAAB,0xA7FFFEA,0x1556AA,0xD55AAAB,0x554FFFF,0x1555,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_464_28 CURVE_Cru_BLS461= {0xFFFFFFE,0x40001F,0xFE00000,0xFFE7FFF,0xF0FFF6F,0x7200C47,0x7BCC604,0x15796DB,0xCF47771,0x9875433,0x613F0E8,0x5000502,0xEBFFF60,0x1FFFFF,0x0,0x0,0x0}; -const BIG_464_28 CURVE_Pxa_BLS461= {0x6D0A37C,0x5B50318,0x75DCC46,0xC2E492E,0xD6878A9,0xE01F919,0xF92F564,0x86DB74F,0x66803F0,0x46D581A,0x7ED78D,0x2F97C29,0xC270C89,0xF679453,0x6A50A9A,0x54138A0,0x10CC}; -const BIG_464_28 CURVE_Pxb_BLS461= {0x2C1C0AD,0xF85CA8C,0x25CADE9,0x6CD66C4,0xA289609,0xC612951,0xEE2401A,0x529ABEB,0xF65B17D,0xBA09D33,0xD4C5AF5,0x4D4371E,0x46A672E,0xA279D22,0xACEA37C,0x1FB4FE5,0x95C}; -const BIG_464_28 CURVE_Pya_BLS461= {0x2FB006,0xCCD0C1B,0xA12A337,0x3D194A4,0xC92C895,0x4960CFC,0x39FC68B,0x3A9B00F,0xED1BA0F,0xA7DBBC5,0xA9CDFD8,0x27CC2F7,0x4E73ED2,0x6070F4F,0xEBA7E67,0xAC848E7,0x226}; -const BIG_464_28 CURVE_Pyb_BLS461= {0xDF1457C,0xA506ADF,0x4C20A8,0xD6A31DC,0x36E3FB4,0xEA9A8F1,0x92F5668,0x3C3BE44,0x67A1297,0x74BEABA,0x56A20BE,0x4C42E38,0x45157F0,0x2AB1D00,0xBB402EA,0x101B4FA,0xE38}; -const BIG_464_28 CURVE_W_BLS461[2]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG_464_28 CURVE_SB_BLS461[2][2]= {{{0x0,0x0,0x0,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0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x 0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - -#endif - -#if CHUNK==64 - -const int CURVE_Cof_I_BLS461= 0; -const int CURVE_A_BLS461= 0; -const int CURVE_B_I_BLS461= 9; -const BIG_464_60 CURVE_B_BLS461= {0x9L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_464_60 CURVE_Order_BLS461= {0x1L,0x7FEFFFEFFFFC0L,0xC017FFC80001100L,0x7FE05FD000E801FL,0xFFFF7FFFC018001L,0xFFL,0x0L,0x0L}; -const BIG_464_60 CURVE_Gx_BLS461= {0x14D026A8ADEE93DL,0xF2D9C00EE74B741L,0x229C3981B531AC7L,0x6650D3564DC9218L,0x436166F7C292A09L,0x2CF668BE922B197L,0x463B73A0C813271L,0xAD0E74E99BL}; -const BIG_464_60 CURVE_Gy_BLS461= {0xF763157AD1D465L,0x5D17884C8C4FF47L,0x9D0A819E66B8D21L,0x910AE5C3245F495L,0x96EECB8BFA40B84L,0x277ACC8BF9F8CBEL,0x5F68C95F1C3F2FL,0x77BCDB14B3L}; - -const BIG_464_60 CURVE_Bnx_BLS461= {0xFFBFFFE00000000L,0x1FFFFL,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_464_60 CURVE_Cof_BLS461= {0xAA7FFFEAAAAAAABL,0xFFD55AAAB01556AL,0x1555554FFL,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_464_60 CURVE_Cru_BLS461= {0x40001FFFFFFFEL,0x6FFFE7FFFFE0000L,0x6047200C47F0FFFL,0x777115796DB7BCCL,0x3F0E89875433CF4L,0xBFFF60500050261L,0x1FFFFFEL,0x0L}; -const BIG_464_60 CURVE_Pxa_BLS461= {0x65B503186D0A37CL,0xA9C2E492E75DCC4L,0x564E01F919D6878L,0x3F086DB74FF92FL,0xED78D46D581A668L,0x270C892F97C2907L,0x6A50A9AF679453CL,0x10CC54138A0L}; -const BIG_464_60 CURVE_Pxb_BLS461= {0x9F85CA8C2C1C0ADL,0x96CD66C425CADEL,0x1AC612951A2896L,0xB17D529ABEBEE24L,0xC5AF5BA09D33F65L,0x6A672E4D4371ED4L,0xACEA37CA279D224L,0x95C1FB4FE5L}; -const BIG_464_60 CURVE_Pya_BLS461= {0x7CCD0C1B02FB006L,0x953D194A4A12A33L,0x68B4960CFCC92C8L,0xBA0F3A9B00F39FCL,0xCDFD8A7DBBC5ED1L,0xE73ED227CC2F7A9L,0xEBA7E676070F4F4L,0x226AC848E7L}; -const BIG_464_60 CURVE_Pyb_BLS461= {0x8A506ADFDF1457CL,0xB4D6A31DC04C20AL,0x668EA9A8F136E3FL,0x12973C3BE4492F5L,0xA20BE74BEABA67AL,0x5157F04C42E3856L,0xB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0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; - - -#endif \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-milagro-crypto/blob/1add7560/version3/c/rom_curve_BLS48.c ---------------------------------------------------------------------- diff --git a/version3/c/rom_curve_BLS48.c b/version3/c/rom_curve_BLS48.c deleted file mode 100644 index ba97dc0..0000000 --- a/version3/c/rom_curve_BLS48.c +++ /dev/null @@ -1,88 +0,0 @@ -#include "arch.h" -#include "ecp_BLS48.h" - -/* Curve BLS48 - Pairing friendly BLS48 curve */ - -#if CHUNK==16 - -#error Not supported - -#endif - -#if CHUNK==32 - -// Base Bits= 29 - -const int CURVE_Cof_I_BLS48= 0; -const int CURVE_A_BLS48= 0; -const int CURVE_B_I_BLS48= 17; -const BIG_560_29 CURVE_B_BLS48= {0x11,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_560_29 CURVE_Order_BLS48= {0x1,0x17FFF800,0xA769C21,0x8AA813C,0x2029C21,0xA68F58B,0xB6307F4,0x1184DA51,0x6DFED78,0x1A3C85E9,0x571037B,0x1637F1F9,0x1C465FB0,0x98354B9,0x118DF17A,0x1422355D,0x43BF73E,0x6,0x0,0x0}; -const BIG_560_29 CURVE_Gx_BLS48= {0x5D71D33,0x1943697B,0x18CB783F,0x1B00AA9F,0x1711EE0B,0x7F80B23,0x129FD8CC,0x1345E03F,0x9A80F66,0x7038173,0xC056511,0x142801F5,0x42B2C3A,0x1AF09869,0x7924166,0x8381264,0x957EDD7,0xBACAEDC,0xA27A4A1,0x13}; -const BIG_560_29 CURVE_Gy_BLS48= {0xA6ED83A,0x14D2D9FF,0xA29C33D,0x1B8972A9,0x6958677,0x19C8F547,0x1DED7E3E,0x14F9E3DC,0x18FB7229,0x27171C0,0x1551E32D,0xE6184CC,0x6260E3C,0x733D204,0x579C437,0x1534665C,0x2B3349D,0x3162FD7,0xB634253,0x1}; - -const BIG_560_29 CURVE_Bnx_BLS48= {0x1DE40020,0x3,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_560_29 CURVE_Cof_BLS48= {0x1F12ABEB,0x516887B,0x5,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; -const BIG_560_29 CURVE_Cru_BLS48= {0xCBBA429,0x1B273F3,0xD3DD160,0x19C61452,0x308093A,0x146E1E34,0xAE0E768,0x1185948,0x1B73BC2D,0x93D855C,0x1B1A639C,0x118C919B,0xFF04AE3,0xF1CCD77,0x91318E5,0x10644780,0x3A79F7,0x1BE77919,0x145F60F3,0x1F}; -const BIG_560_29 CURVE_Pxaaa_BLS48= {0x923CE4A,0x14697474,0xAE04F4A,0x17AE205A,0x1313A20C,0x10B2EC50,0x18DF074F,0x15FE3FE8,0x7C90B98,0x959BF85,0xE57BD37,0x14376C96,0xBF57375,0xE20B625,0x12EE2172,0x1CBBCE85,0x1A5D9487,0xD0E024B,0x195E3602,0x1C}; -const BIG_560_29 CURVE_Pxaab_BLS48= {0xC0A1BE1,0x138E6E2D,0x1DF5FDC,0x151FC760,0x33972C5,0x56AA3C2,0x2491D8C,0x115B9FD7,0x140A11FA,0x1873AE35,0x1F259C26,0x74B0647,0x12D18B04,0x4672431,0x1C27F419,0x1CAA4D35,0x18DB48B6,0x13A54BDA,0x5080497,0x5}; -const BIG_560_29 CURVE_Pxaba_BLS48= {0x170C5DC4,0x11D39263,0x16B3BCB6,0x152C95BB,0x19BEC736,0x8849A12,0x49AB2A8,0xC7162D3,0xC58CD55,0x15C2659,0x11EE8B90,0xB40CAFC,0xE233167,0x7BEC8BE,0x129335BD,0x151C7DBB,0x78B689B,0x1B6B8EED,0x14BFBE3D,0x16}; -const BIG_560_29 CURVE_Pxabb_BLS48= {0x1A64B740,0x6B14B34,0x12481578,0x23FA931,0x323ADD1,0x206B82A,0xD789E1B,0x1FCFA666,0x1F4EEA7,0xF1E39E2,0x1968610,0xAF3EBD3,0x590D3B,0xDA0C35A,0x17306AAF,0xCF9DD2B,0x3F63B1A,0x96FF2F9,0xE102A76,0x12}; -const BIG_560_29 CURVE_Pxbaa_BLS48= {0x12F1E01F,0xDD8630B,0x12C29802,0x186239A6,0x19218788,0x4C87D1,0x16AE2501,0x775C076,0x870C80B,0x1A394429,0x1637D478,0x4A420E8,0x1C3AD4D4,0x10E5E713,0x111E6AD5,0x514FCF0,0x7CC49D3,0xC678A2,0x1787BDFD,0x1B}; -const BIG_560_29 CURVE_Pxbab_BLS48= {0x637383D,0x1851C11C,0x661F866,0x14404A7F,0x15D3D212,0x9AE28F6,0x8051F25,0x1E1CE2BF,0x137D882F,0xB231CEB,0xA8DB8FC,0x18957645,0x5E54DA8,0x1FF41C44,0x1A297414,0x17E1CBC5,0x1014F91F,0x4282AB7,0xB6CE9E3,0x10}; -const BIG_560_29 CURVE_Pxbba_BLS48= {0x1711939C,0xB41ED9E,0x69066BA,0x137CA3AD,0xCF2F6C0,0x5E6DAB9,0x2CE1323,0x946E448,0xF353D1C,0x14D9919F,0x46B7046,0x1A12015,0x3D6070,0x18C3E8D2,0x1F23BA45,0x1F1A337C,0x435A9CC,0x6CA1DF1,0x8A9CE1,0x15}; -const BIG_560_29 CURVE_Pxbbb_BLS48= {0x56F4899,0x196A0854,0xA959750,0x38A3D72,0x190BC9BC,0x145752BC,0x1E9E26DA,0x1403F88,0x71895E3,0x14162F5D,0x19FEC5FF,0x14190B16,0x7597C,0x19A3CF18,0x26A4B00,0x113D1BB6,0x7857A32,0xE0B78AB,0x1DD51E0F,0x1B}; -const BIG_560_29 CURVE_Pyaaa_BLS48= {0x14137844,0x1704BE7D,0x1FD3CCDD,0x189D8C93,0x1C768851,0xF5C37D5,0xE29C659,0x20AB1C1,0xF8896E0,0x1E08663E,0x1D1D539C,0x117E1C47,0x156CDD39,0x161F1017,0x143E8C72,0x174B22FD,0x18706190,0x49AA47E,0x19BB42E1,0xE}; -const BIG_560_29 CURVE_Pyaab_BLS48= {0xDC83190,0x12F19247,0x1AA26424,0x15D55E88,0xC418D32,0xB0E91DD,0x47CBFF7,0x2D992C1,0xDE03C1F,0x7694AE5,0x5C741A2,0x1D423AC6,0x5E02B9E,0x1E903F10,0x4EA6513,0x433A1F1,0x8EFA1C4,0xED54713,0x1E72CE4F,0x4}; -const BIG_560_29 CURVE_Pyaba_BLS48= {0x1985C0D,0xEE2FE82,0x64770FA,0x11A809B4,0x1483ACE9,0x18BCD2FA,0x171F32C,0x1612D58D,0x1E658341,0x1CBE2201,0x186E971,0x73F0E1,0xB0A5F40,0xAC90FB0,0x1635E008,0x237498B,0x1F3140D6,0xBF789A9,0x1166F259,0x1A}; -const BIG_560_29 CURVE_Pyabb_BLS48= {0x159D42F8,0x1B7F0540,0x45895D7,0x14875FA2,0x1E9E7F2B,0x10139D87,0x10F3FD7D,0x11D3717F,0x69E5006,0xF9BB3C4,0x13C9ED8D,0x16516DA,0x102F51DE,0x2725FEC,0x1F125B66,0xFFC324,0x1ED80731,0x1C16C4D,0x383AAA8,0x14}; -const BIG_560_29 CURVE_Pybaa_BLS48= {0x1F38039F,0x6A8959C,0x13C68984,0x11DD12AF,0x58093CF,0x1C8550A0,0xFFA1622,0xFF85979,0x1F2ABB75,0x18862E62,0x1EB6A2C9,0x1EC80B64,0x8EC2F18,0xE7BF713,0xC36B65A,0x19C5DD89,0x18A1D1AB,0xF772C8D,0xC11927C,0x5}; -const BIG_560_29 CURVE_Pybab_BLS48= {0x95F7865,0x134F0379,0x1CE9A0E,0x17E0EADD,0x1DACADD7,0x1B18F9F8,0x181D3943,0x186679A,0x2505BB0,0x1FDF1DC8,0x11B36A49,0x11E254E9,0xA438576,0x102B09AE,0x139984F4,0x15BC0233,0x1B6F180E,0x960562B,0x48CA65B,0x6}; -const BIG_560_29 CURVE_Pybba_BLS48= {0x7CC1979,0xEC1D4FB,0x1D89E6F0,0x955F38E,0x1635FDA9,0x123D8E10,0x10076209,0x494404A,0xD733D7,0x17678BCF,0x153841F9,0x10696FFD,0x5BC9FE8,0x1A20D8B2,0xE22EC9D,0x18449116,0x108C86C5,0x1B4CD720,0x34967,0x19}; -const BIG_560_29 CURVE_Pybbb_BLS48= {0xFC9F25B,0x7E44AB1,0xE9AB5D3,0x589F00D,0x1C9D264F,0xC7478B4,0x16B24A13,0x1D2C146B,0xEF84D9A,0xF47ECDE,0x1BFEE16A,0x1B69071E,0x11AB4C1C,0xBE9D9EF,0x390F005,0x78C8288,0x1B9BF549,0x9320730,0x3D84D97,0x14}; -const BIG_560_29 CURVE_W_BLS48[2]= {{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}; -const BIG_560_29 CURVE_SB_BLS48[2][2]= {{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,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0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0 x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}},{{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0},{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}}}; - - -#endif - -#if CHUNK==64 - -// Base Bits= 58 - -const int CURVE_Cof_I_BLS48= 0; -const int CURVE_A_BLS48= 0; -const int CURVE_B_I_BLS48= 17; -const BIG_560_58 CURVE_B_BLS48= {0x11L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_560_58 CURVE_Order_BLS48= {0x2FFFF0000000001L,0x11550278A769C21L,0x14D1EB162029C21L,0x2309B4A2B6307F4L,0x34790BD26DFED78L,0x2C6FE3F2571037BL,0x1306A973C465FB0L,0x28446ABB18DF17AL,0xC43BF73EL,0x0L}; -const BIG_560_58 CURVE_Gx_BLS48= {0x3286D2F65D71D33L,0x3601553F8CB783FL,0xFF01647711EE0BL,0x268BC07F29FD8CCL,0xE0702E69A80F66L,0x285003EAC056511L,0x35E130D242B2C3AL,0x107024C87924166L,0x17595DB8957EDD7L,0x26A27A4A1L}; -const BIG_560_58 CURVE_Gy_BLS48= {0x29A5B3FEA6ED83AL,0x3712E552A29C33DL,0x3391EA8E6958677L,0x29F3C7B9DED7E3EL,0x4E2E3818FB7229L,0x1CC30999551E32DL,0xE67A4086260E3CL,0x2A68CCB8579C437L,0x62C5FAE2B3349DL,0x2B634253L}; - -const BIG_560_58 CURVE_Bnx_BLS48= {0x7DE40020L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_560_58 CURVE_Cof_BLS48= {0xA2D10F7F12ABEBL,0x5L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}; -const BIG_560_58 CURVE_Cru_BLS48= {0x364E7E6CBBA429L,0x338C28A4D3DD160L,0x28DC3C68308093AL,0x230B290AE0E768L,0x127B0AB9B73BC2DL,0x23192337B1A639CL,0x1E399AEEFF04AE3L,0x20C88F0091318E5L,0x37CEF23203A79F7L,0x3F45F60F3L}; -const BIG_560_58 CURVE_Pxaaa_BLS48= {0x28D2E8E8923CE4AL,0x2F5C40B4AE04F4AL,0x2165D8A1313A20CL,0x2BFC7FD18DF074FL,0x12B37F0A7C90B98L,0x286ED92CE57BD37L,0x1C416C4ABF57375L,0x39779D0B2EE2172L,0x1A1C0497A5D9487L,0x3995E3602L}; -const BIG_560_58 CURVE_Pxaab_BLS48= {0x271CDC5AC0A1BE1L,0x2A3F8EC01DF5FDCL,0xAD5478433972C5L,0x22B73FAE2491D8CL,0x30E75C6B40A11FAL,0xE960C8FF259C26L,0x8CE48632D18B04L,0x39549A6BC27F419L,0x274A97B58DB48B6L,0xA5080497L}; -const BIG_560_58 CURVE_Pxaba_BLS48= {0x23A724C770C5DC4L,0x2A592B776B3BCB6L,0x110934259BEC736L,0x18E2C5A649AB2A8L,0x2B84CB2C58CD55L,0x168195F91EE8B90L,0xF7D917CE233167L,0x2A38FB7729335BDL,0x36D71DDA78B689BL,0x2D4BFBE3DL}; -const BIG_560_58 CURVE_Pxabb_BLS48= {0xD629669A64B740L,0x47F52632481578L,0x40D7054323ADD1L,0x3F9F4CCCD789E1BL,0x1E3C73C41F4EEA7L,0x15E7D7A61968610L,0x1B4186B40590D3BL,0x19F3BA577306AAFL,0x12DFE5F23F63B1AL,0x24E102A76L}; -const BIG_560_58 CURVE_Pxbaa_BLS48= {0x1BB0C6172F1E01FL,0x30C4734D2C29802L,0x990FA39218788L,0xEEB80ED6AE2501L,0x34728852870C80BL,0x94841D1637D478L,0x21CBCE27C3AD4D4L,0xA29F9E111E6AD5L,0x18CF1447CC49D3L,0x37787BDFDL}; -const BIG_560_58 CURVE_Pxbab_BLS48= {0x30A38238637383DL,0x288094FE661F866L,0x135C51ED5D3D212L,0x3C39C57E8051F25L,0x164639D737D882FL,0x312AEC8AA8DB8FCL,0x3FE838885E54DA8L,0x2FC3978BA297414L,0x850556F014F91FL,0x20B6CE9E3L}; -const BIG_560_58 CURVE_Pxbba_BLS48= {0x1683DB3D711939CL,0x26F9475A69066BAL,0xBCDB572CF2F6C0L,0x128DC8902CE1323L,0x29B3233EF353D1CL,0x342402A46B7046L,0x3187D1A403D6070L,0x3E3466F9F23BA45L,0xD943BE2435A9CCL,0x2A08A9CE1L}; -const BIG_560_58 CURVE_Pxbbb_BLS48= {0x32D410A856F4899L,0x7147AE4A959750L,0x28AEA57990BC9BCL,0x2807F11E9E26DAL,0x282C5EBA71895E3L,0x2832162D9FEC5FFL,0x33479E30007597CL,0x227A376C26A4B00L,0x1C16F1567857A32L,0x37DD51E0FL}; -const BIG_560_58 CURVE_Pyaaa_BLS48= {0x2E097CFB4137844L,0x313B1927FD3CCDDL,0x1EB86FABC768851L,0x4156382E29C659L,0x3C10CC7CF8896E0L,0x22FC388FD1D539CL,0x2C3E202F56CDD39L,0x2E9645FB43E8C72L,0x93548FD8706190L,0x1D9BB42E1L}; -const BIG_560_58 CURVE_Pyaab_BLS48= {0x25E3248EDC83190L,0x2BAABD11AA26424L,0x161D23BAC418D32L,0x5B3258247CBFF7L,0xED295CADE03C1FL,0x3A84758C5C741A2L,0x3D207E205E02B9EL,0x86743E24EA6513L,0x1DAA8E268EFA1C4L,0x9E72CE4FL}; -const BIG_560_58 CURVE_Pyaba_BLS48= {0x1DC5FD041985C0DL,0x2350136864770FAL,0x3179A5F5483ACE9L,0x2C25AB1A171F32CL,0x397C4403E658341L,0xE7E1C2186E971L,0x15921F60B0A5F40L,0x46E9317635E008L,0x17EF1353F3140D6L,0x35166F259L}; -const BIG_560_58 CURVE_Pyabb_BLS48= {0x36FE0A8159D42F8L,0x290EBF4445895D7L,0x20273B0FE9E7F2BL,0x23A6E2FF0F3FD7DL,0x1F37678869E5006L,0x2CA2DB53C9ED8DL,0x4E4BFD902F51DEL,0x1FF8649F125B66L,0x382D89BED80731L,0x28383AAA8L}; -const BIG_560_58 CURVE_Pybaa_BLS48= {0xD512B39F38039FL,0x23BA255F3C68984L,0x390AA14058093CFL,0x1FF0B2F2FFA1622L,0x310C5CC5F2ABB75L,0x3D9016C9EB6A2C9L,0x1CF7EE268EC2F18L,0x338BBB12C36B65AL,0x1EEE591B8A1D1ABL,0xAC11927CL}; -const BIG_560_58 CURVE_Pybab_BLS48= {0x269E06F295F7865L,0x2FC1D5BA1CE9A0EL,0x3631F3F1DACADD7L,0x30CCF3581D3943L,0x3FBE3B902505BB0L,0x23C4A9D31B36A49L,0x2056135CA438576L,0x2B78046739984F4L,0x12C0AC57B6F180EL,0xC48CA65BL}; -const BIG_560_58 CURVE_Pybba_BLS48= {0x1D83A9F67CC1979L,0x12ABE71DD89E6F0L,0x247B1C21635FDA9L,0x92880950076209L,0x2ECF179E0D733D7L,0x20D2DFFB53841F9L,0x3441B1645BC9FE8L,0x3089222CE22EC9DL,0x3699AE4108C86C5L,0x320034967L}; -const BIG_560_58 CURVE_Pybbb_BLS48= {0xFC89562FC9F25BL,0xB13E01AE9AB5D3L,0x18E8F169C9D264FL,0x3A5828D76B24A13L,0x1E8FD9BCEF84D9AL,0x36D20E3DBFEE16AL,0x17D3B3DF1AB4C1CL,0xF190510390F005L,0x12640E61B9BF549L,0x283D84D97L}; -const BIG_560_58 CURVE_W_BLS48[2]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_560_58 CURVE_SB_BLS48[2][2]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}}; -const BIG_560_58 CURVE_WB_BLS48[4]= {{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}}; -const BIG_560_58 CURVE_BB_BLS48[4][4]= {{{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L},{0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L,0x0L}},{{0x0L,0x0L,0x0L,0x0L,0x0L,0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