Lines Matching refs:bkey

166 dsa_genkey_pair(DSAbytekey *bkey)
174 prime_bytes = CRYPTO_BITS2BYTES(bkey->prime_bits);
186 subprime_bytes = CRYPTO_BITS2BYTES(bkey->subprime_bits);
192 if (bkey->public_y == NULL || bkey->private_x == NULL) {
200 if ((brv = DSA_key_init(&dsakey, bkey->prime_bits)) != BIG_OK) {
211 bytestring2bignum(&(dsakey.p), bkey->prime, prime_bytes);
219 bytestring2bignum(&(dsakey.q), bkey->subprime, subprime_bytes);
223 CHARLEN2BIGNUMLEN(bkey->base_bytes))) != BIG_OK) {
227 bytestring2bignum(&(dsakey.g), bkey->base, bkey->base_bytes);
233 if ((rv = generate_dsa_key(&dsakey, bkey->rfunc)) !=
238 bkey->public_y_bits = CRYPTO_BYTES2BITS(prime_bytes);
239 bignum2bytestring(bkey->public_y, &(dsakey.y), prime_bytes);
241 bkey->private_x_bits = CRYPTO_BYTES2BITS(DSA_SUBPRIME_BYTES);
242 bignum2bytestring(bkey->private_x, &(dsakey.x), DSA_SUBPRIME_BYTES);
254 dsa_sign(DSAbytekey *bkey, uchar_t *in, uint32_t inlen, uchar_t *out)
265 prime_bytes = CRYPTO_BITS2BYTES(bkey->prime_bits);
266 subprime_bytes = CRYPTO_BITS2BYTES(bkey->subprime_bits);
272 value_bytes = CRYPTO_BITS2BYTES(bkey->private_x_bits); /* len of x */
282 if ((brv = DSA_key_init(&dsakey, bkey->prime_bits)) != BIG_OK) {
291 bytestring2bignum(&(dsakey.p), bkey->prime, prime_bytes);
298 bytestring2bignum(&(dsakey.q), bkey->subprime, subprime_bytes);
301 CHARLEN2BIGNUMLEN(bkey->base_bytes))) != BIG_OK) {
305 bytestring2bignum(&(dsakey.g), bkey->base, bkey->base_bytes);
312 bytestring2bignum(&(dsakey.x), bkey->private_x, value_bytes);
333 rf = bkey->rfunc;
421 dsa_verify(DSAbytekey *bkey, uchar_t *data, uchar_t *sig)
431 prime_bytes = CRYPTO_BITS2BYTES(bkey->prime_bits);
432 subprime_bytes = CRYPTO_BITS2BYTES(bkey->subprime_bits);
438 if (prime_bytes < bkey->base_bytes) {
442 value_bytes = CRYPTO_BITS2BYTES(bkey->public_y_bits); /* len of y */
451 if (DSA_key_init(&dsakey, bkey->prime_bits) != BIG_OK) {
460 bytestring2bignum(&(dsakey.p), bkey->prime, prime_bytes);
467 bytestring2bignum(&(dsakey.q), bkey->subprime, subprime_bytes);
470 CHARLEN2BIGNUMLEN(bkey->base_bytes))) != BIG_OK) {
474 bytestring2bignum(&(dsakey.g), bkey->base, bkey->base_bytes);
481 bytestring2bignum(&(dsakey.y), bkey->public_y, value_bytes);