• Home
  • Raw
  • Download

Lines Matching refs:dhg

46 parse_prime(int linenum, char *line, struct dhgroup *dhg)  in parse_prime()  argument
53 dhg->p = dhg->g = NULL; in parse_prime()
95 (dhg->size = (int)strtonum(strsize, 0, 64*1024, &errstr)) == 0 || in parse_prime()
101 dhg->size++; in parse_prime()
112 if ((dhg->g = BN_new()) == NULL || in parse_prime()
113 (dhg->p = BN_new()) == NULL) { in parse_prime()
117 if (BN_hex2bn(&dhg->g, gen) == 0) { in parse_prime()
121 if (BN_hex2bn(&dhg->p, prime) == 0) { in parse_prime()
125 if (BN_num_bits(dhg->p) != dhg->size) { in parse_prime()
127 linenum, BN_num_bits(dhg->p), dhg->size - 1); in parse_prime()
130 if (BN_cmp(dhg->g, BN_value_one()) <= 0) { in parse_prime()
137 if (dhg->g != NULL) in parse_prime()
138 BN_clear_free(dhg->g); in parse_prime()
139 if (dhg->p != NULL) in parse_prime()
140 BN_clear_free(dhg->p); in parse_prime()
141 dhg->g = dhg->p = NULL; in parse_prime()
152 struct dhgroup dhg; in choose_dh() local
164 if (!parse_prime(linenum, line, &dhg)) in choose_dh()
166 BN_clear_free(dhg.g); in choose_dh()
167 BN_clear_free(dhg.p); in choose_dh()
169 if (dhg.size > max || dhg.size < min) in choose_dh()
172 if ((dhg.size > wantbits && dhg.size < best) || in choose_dh()
173 (dhg.size > best && best < wantbits)) { in choose_dh()
174 best = dhg.size; in choose_dh()
177 if (dhg.size == best) in choose_dh()
191 if (!parse_prime(linenum, line, &dhg)) in choose_dh()
193 if ((dhg.size > max || dhg.size < min) || in choose_dh()
194 dhg.size != best || in choose_dh()
196 BN_clear_free(dhg.g); in choose_dh()
197 BN_clear_free(dhg.p); in choose_dh()
209 return (dh_new_group(dhg.g, dhg.p)); in choose_dh()