projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Factor out common code to construct CHANNEL_REQUESTS.
[u/mdw/putty]
/
sshrsag.c
diff --git
a/sshrsag.c
b/sshrsag.c
index
eb714ad
..
dbe8940
100644
(file)
--- a/
sshrsag.c
+++ b/
sshrsag.c
@@
-10,6
+10,7
@@
int rsa_generate(struct RSAKey *key, int bits, progfn_t pfn,
void *pfnparam)
{
Bignum pm1, qm1, phi_n;
void *pfnparam)
{
Bignum pm1, qm1, phi_n;
+ unsigned pfirst, qfirst;
/*
* Set up the phase limits for the progress report. We do this
/*
* Set up the phase limits for the progress report. We do this
@@
-59,10
+60,11
@@
int rsa_generate(struct RSAKey *key, int bits, progfn_t pfn,
* general that's slightly more fiddly to arrange. By choosing
* a prime e, we can simplify the criterion.)
*/
* general that's slightly more fiddly to arrange. By choosing
* a prime e, we can simplify the criterion.)
*/
+ invent_firstbits(&pfirst, &qfirst);
key->p = primegen(bits / 2, RSA_EXPONENT, 1, NULL,
key->p = primegen(bits / 2, RSA_EXPONENT, 1, NULL,
- 1, pfn, pfnparam);
+ 1, pfn, pfnparam
, pfirst
);
key->q = primegen(bits - bits / 2, RSA_EXPONENT, 1, NULL,
key->q = primegen(bits - bits / 2, RSA_EXPONENT, 1, NULL,
- 2, pfn, pfnparam);
+ 2, pfn, pfnparam
, qfirst
);
/*
* Ensure p > q, by swapping them if not.
/*
* Ensure p > q, by swapping them if not.