hcrypto: make libtommath v1.2.0 work with Heimdal

This commit is contained in:
Luke Howard
2020-04-12 18:38:00 +10:00
parent c403b66082
commit 7eb397834e
5 changed files with 323 additions and 234 deletions

View File

@@ -536,7 +536,7 @@ ltm_rsa_generate_key(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
do {
BN_GENCB_call(cb, 2, counter++);
CHECK(random_num(&p, bitsp), 0);
CHECK(mp_find_prime(&p,128), MP_YES);
CHECK(mp_prime_next_prime(&p,128,0), MP_OKAY);
mp_sub_d(&p, 1, &t1);
mp_gcd(&t1, &el, &t2);
@@ -548,7 +548,7 @@ ltm_rsa_generate_key(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)
do {
BN_GENCB_call(cb, 2, counter++);
CHECK(random_num(&q, bits - bitsp), 0);
CHECK(mp_find_prime(&q,128), MP_YES);
CHECK(mp_prime_next_prime(&q,128,0), MP_OKAY);
if (mp_cmp(&p, &q) == 0) /* don't let p and q be the same */
continue;