{
FILE* fp;
PM=mirsys (1000, 0);
PM - & gt; IOBASE=16;
Big Gx, Gy, x1, y1, x2, y2;
P=mirvar (0);
A=mirvar (0);
B=mirvar (0);
N=mirvar (0);
Gx=mirvar (0);
Gy=mirvar (0);
The db=mirvar (0);
Cinstr (p, para. P);
Cinstr (a, para. A);
Cinstr (b, para. B);
Cinstr (n, para. N);
Cinstr (Gx, para. Gx);
Cinstr (Gy, para. Gy);
Ecurve_init (a, b, p, MR_AFFINE);//initialize the elliptic curve
Epoint * C1=NULL;
Epoint * kPb=NULL;
G=epoint_init ();//memory allocated to Gf (p) an elliptic curve points initialized to infinity
Pb=epoint_init ();
C1=epoint_init ();
KPb=epoint_init ();
//if the set point coordinates belong to the current equation, return true not satisfy
return falseif (! Epoint_set (Gx, Gy, 1, G));
{
exit(0);
}
//generated public key private key Pb=G * db
Printf (" n "); Cotnum (n, stdout);
Bigrand (n, db);
Printf (" private key db=");
Cotnum (db, stdout);
//generated public key pb=G * db
Ecurve_mult (db, G, Pb);
Parameters: \ np: printf (" % s \ na: % s \ nb: % s \ nn % s \ \ n \ nGy nGx % s % s ", p, a, b, n, Gx, Gy);
}//key to generate (db, Pb) db for the private key to Pb for public key
Int main (void)
{
InitSM2 ();
return 0;
}
CodePudding user response:
Format match, look not to come out ~ from the codeCodePudding user response:
Match, use a third-party cryptography libraryCodePudding user response:
Debug it and see, you seeCodePudding user response:
Parameters: \ np: printf (" % s \ na: % s \ nb: % s \ nn % s \ \ n \ nGy nGx % s % s ", p, a, b, n, Gx, Gy);Must be a variable and the matching problem of format character