src/mpin.c.in [333:369]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int res=0; if (RNG!=NULL) { BIG_XXX_rcopy(r,CURVE_Order_ZZZ); BIG_XXX_randomnum(x,r,RNG); #ifdef AES_S BIG_XXX_mod2m(x,2*AES_S); #endif X->len=MODBYTES_XXX; BIG_XXX_toBytes(X->val,x); } else BIG_XXX_fromBytes(x,X->val); if (type==0) { if (!ECP_ZZZ_fromOctet(&P,G)) res=MPIN_INVALID_POINT; } else { ECP_ZZZ_mapit(&P,G); } if (res==0) { PAIR_ZZZ_G1mul(&P,x); ECP_ZZZ_toOctet(W,&P,false); } return res; } /* if RNG == NULL then X is passed in if RNG != NULL the X is passed out W=x*G where G is point on the curve if type==1 W=(x^-1)G */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/mpin192.c.in [320:356]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int res=0; if (RNG!=NULL) { BIG_XXX_rcopy(r,CURVE_Order_ZZZ); BIG_XXX_randomnum(x,r,RNG); #ifdef AES_S BIG_XXX_mod2m(x,2*AES_S); #endif X->len=MODBYTES_XXX; BIG_XXX_toBytes(X->val,x); } else BIG_XXX_fromBytes(x,X->val); if (type==0) { if (!ECP_ZZZ_fromOctet(&P,G)) res=MPIN_INVALID_POINT; } else { ECP_ZZZ_mapit(&P,G); } if (res==0) { PAIR_ZZZ_G1mul(&P,x); ECP_ZZZ_toOctet(W,&P,false); } return res; } /* if RNG == NULL then X is passed in if RNG != NULL the X is passed out W=x*G where G is point on the curve if type==1 W=(x^-1)G */ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -