6 rsafill(mpint *n, mpint *e, mpint *d, mpint *p, mpint *q)
8 mpint *c2, *kq, *kp, *x;
11 // make sure we're not being hoodwinked
12 if(!probably_prime(p, 10) || !probably_prime(q, 10)){
13 werrstr("rsafill: p or q not prime");
19 werrstr("rsafill: n != p*q");
29 if(mpcmp(x, mpone) != 0){
30 werrstr("rsafill: e*d != 1 mod (p-1)*(q-1)");
36 // compute chinese remainder coefficient
39 // for crt a**k mod p == (a**(k mod p-1)) mod p
48 rsa->pub.ek = mpcopy(e);
49 rsa->pub.n = mpcopy(n);