Lines Matching refs:dh
57 #include <openssl/dh.h>
64 int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) {
77 if (!BN_copy(&q, dh->p) ||
93 int DH_check(const DH *dh, int *ret) {
121 if (dh->q) {
122 if (BN_cmp(dh->g, BN_value_one()) <= 0) {
124 } else if (BN_cmp(dh->g, dh->p) >= 0) {
128 if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx)) {
135 if (!BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL)) {
139 if (!BN_div(t1, t2, dh->p, dh->q, ctx)) {
145 if (dh->j && BN_cmp(dh->j, t1)) {
148 } else if (BN_is_word(dh->g, DH_GENERATOR_2)) {
149 l = BN_mod_word(dh->p, 24);
153 } else if (BN_is_word(dh->g, DH_GENERATOR_5)) {
154 l = BN_mod_word(dh->p, 10);
162 if (!BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL)) {
164 } else if (!dh->q) {
165 if (!BN_rshift1(t1, dh->p)) {