Latest update.

This commit is contained in:
2019-10-17 23:54:38 +09:00
parent 41a23ae6f6
commit ee84d0dd84
1357 changed files with 41111 additions and 9603 deletions
+4 -6
View File
@@ -10,9 +10,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
#include <openssl/bn.h>
#include "dh_locl.h"
# define DH_NUMBER_ITERATIONS_FOR_PRIME 64
#include "dh_local.h"
/*-
* Check that p and g are suitable enough
@@ -137,7 +135,7 @@ int DH_check(const DH *dh, int *ret)
if (!BN_is_one(t1))
*ret |= DH_NOT_SUITABLE_GENERATOR;
}
r = BN_is_prime_ex(dh->q, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL);
r = BN_check_prime(dh->q, ctx, NULL);
if (r < 0)
goto err;
if (!r)
@@ -151,7 +149,7 @@ int DH_check(const DH *dh, int *ret)
*ret |= DH_CHECK_INVALID_J_VALUE;
}
r = BN_is_prime_ex(dh->p, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL);
r = BN_check_prime(dh->p, ctx, NULL);
if (r < 0)
goto err;
if (!r)
@@ -159,7 +157,7 @@ int DH_check(const DH *dh, int *ret)
else if (!dh->q) {
if (!BN_rshift1(t1, dh->p))
goto err;
r = BN_is_prime_ex(t1, DH_NUMBER_ITERATIONS_FOR_PRIME, ctx, NULL);
r = BN_check_prime(t1, ctx, NULL);
if (r < 0)
goto err;
if (!r)