Lines Matching defs:dhkey
128 DHkey dhkey;
151 if ((brv = DH_key_init(&dhkey, bkey->prime_bits)) != BIG_OK) {
157 if ((brv = big_extend(&(dhkey.p), CHARLEN2BIGNUMLEN(prime_bytes))) !=
162 bytestring2bignum(&(dhkey.p), bkey->prime, prime_bytes);
165 if ((brv = big_extend(&(dhkey.g),
170 bytestring2bignum(&(dhkey.g), bkey->base, bkey->base_bytes);
173 if (big_cmp_abs(&(dhkey.g), &(dhkey.p)) >= 0) {
185 primebit_len = big_bitlength(&(dhkey.p));
196 if ((brv = big_extend(&(dhkey.x), BITLEN2BIGNUMLEN(bkey->value_bits)))
202 if ((brv = big_extend(&(dhkey.y), CHARLEN2BIGNUMLEN(prime_bytes)))
221 if ((brv = big_random(&(dhkey.x), bkey->value_bits, rf)) != BIG_OK) {
230 if ((brv = big_modexp(&(dhkey.y), &(dhkey.g), &(dhkey.x),
231 &(dhkey.p), NULL)) != BIG_OK) {
236 bignum2bytestring(bkey->private_x, &(dhkey.x),
238 bignum2bytestring(bkey->public_y, &(dhkey.y), prime_bytes);
241 DH_key_finish(&dhkey);
256 DHkey dhkey;
283 if ((brv = DH_key_init(&dhkey, bkey->prime_bits)) != BIG_OK) {
289 if ((brv = big_extend(&(dhkey.p), CHARLEN2BIGNUMLEN(prime_bytes))) !=
294 bytestring2bignum(&(dhkey.p), bkey->prime, prime_bytes);
297 if ((brv = big_extend(&(dhkey.x), CHARLEN2BIGNUMLEN(value_bytes))) !=
302 bytestring2bignum(&(dhkey.x), bkey->private_x, value_bytes);
305 if ((brv = big_extend(&(dhkey.y), CHARLEN2BIGNUMLEN(prime_bytes))) !=
310 bytestring2bignum(&(dhkey.y), bkey->public_y, prime_bytes);
316 if ((brv = big_extend(&(dhkey.g), CHARLEN2BIGNUMLEN(prime_bytes))) !=
322 if ((brv = big_modexp(&(dhkey.g), &(dhkey.y), &(dhkey.x),
323 &(dhkey.p), NULL)) != BIG_OK) {
341 s_bytes = dhkey.g.len * (int)sizeof (BIG_CHUNK_TYPE);
342 bignum2bytestring(s, &(dhkey.g), s_bytes);
390 DH_key_finish(&dhkey);