src/mpin192.c.in [82:208]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HASH512_hash(&sha512,h); break; } OCT_jbytes(w,h,AESKEY_ZZZ); for (i=0; ival[0]=su+2*sv; BIG_XXX_toBytes(&(E->val[1]),u); BIG_XXX_toBytes(&(E->val[PFS_ZZZ+1]),v); } return res; } int MPIN_ZZZ_DECODING(octet *D) { int su,sv; BIG_XXX u,v; ECP_ZZZ P,W; int res=0; if ((D->val[0]&0x04)!=0) res=MPIN_INVALID_POINT; if (res==0) { BIG_XXX_fromBytes(u,&(D->val[1])); BIG_XXX_fromBytes(v,&(D->val[PFS_ZZZ+1])); su=D->val[0]&1; sv=(D->val[0]>>1)&1; map(&W,u,su); map(&P,v,sv); ECP_ZZZ_add(&P,&W); ECP_ZZZ_toOctet(D,&P,false); } return res; } /* R=R1+R2 in group G1 */ int MPIN_ZZZ_RECOMBINE_G1(octet *R1,octet *R2,octet *R) { ECP_ZZZ P,T; int res=0; if (res==0) { if (!ECP_ZZZ_fromOctet(&P,R1)) res=MPIN_INVALID_POINT; if (!ECP_ZZZ_fromOctet(&T,R2)) res=MPIN_INVALID_POINT; } if (res==0) { ECP_ZZZ_add(&P,&T); ECP_ZZZ_toOctet(R,&P,false); } return res; } /* W=W1+W2 in group G2 */ int MPIN_ZZZ_RECOMBINE_G2(octet *W1,octet *W2,octet *W) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - src/mpin256.c.in [105:231]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HASH512_hash(&sha512,h); break; } OCT_jbytes(w,h,AESKEY_ZZZ); for (i=0; ival[0]=su+2*sv; BIG_XXX_toBytes(&(E->val[1]),u); BIG_XXX_toBytes(&(E->val[PFS_ZZZ+1]),v); } return res; } int MPIN_ZZZ_DECODING(octet *D) { int su,sv; BIG_XXX u,v; ECP_ZZZ P,W; int res=0; if ((D->val[0]&0x04)!=0) res=MPIN_INVALID_POINT; if (res==0) { BIG_XXX_fromBytes(u,&(D->val[1])); BIG_XXX_fromBytes(v,&(D->val[PFS_ZZZ+1])); su=D->val[0]&1; sv=(D->val[0]>>1)&1; map(&W,u,su); map(&P,v,sv); ECP_ZZZ_add(&P,&W); ECP_ZZZ_toOctet(D,&P,false); } return res; } /* R=R1+R2 in group G1 */ int MPIN_ZZZ_RECOMBINE_G1(octet *R1,octet *R2,octet *R) { ECP_ZZZ P,T; int res=0; if (res==0) { if (!ECP_ZZZ_fromOctet(&P,R1)) res=MPIN_INVALID_POINT; if (!ECP_ZZZ_fromOctet(&T,R2)) res=MPIN_INVALID_POINT; } if (res==0) { ECP_ZZZ_add(&P,&T); ECP_ZZZ_toOctet(R,&P,false); } return res; } /* W=W1+W2 in group G2 */ int MPIN_ZZZ_RECOMBINE_G2(octet *W1,octet *W2,octet *W) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -