Lines Matching defs:priv_key

99     BN_clear_free(r->priv_key);
144 if (src->priv_key != NULL) {
145 if (dest->priv_key == NULL) {
146 dest->priv_key = BN_new();
147 if (dest->priv_key == NULL)
150 if (!BN_copy(dest->priv_key, src->priv_key))
254 BIGNUM *priv_key = NULL;
265 if (eckey->priv_key == NULL) {
266 priv_key = BN_secure_new();
267 if (priv_key == NULL)
270 priv_key = eckey->priv_key;
283 * Steps (3-7): priv_key = DRBG_RAND(order_n_bits) (range [1, n-1]).
303 if (!BN_priv_rand_range_ex(priv_key, order, 0, ctx))
305 while (BN_is_zero(priv_key)) ;
314 /* Step (8) : pub_key = priv_key * G (where G is a point on the curve) */
315 if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx))
318 eckey->priv_key = priv_key;
320 priv_key = NULL;
341 BN_clear(eckey->priv_key);
347 BN_clear_free(priv_key);
368 * pub_key = priv_key * G (where G is a point on the curve)
370 ret = EC_POINT_mul(eckey->group, eckey->pub_key, eckey->priv_key, NULL,
512 if (eckey == NULL || eckey->group == NULL || eckey->priv_key == NULL) {
516 if (BN_cmp(eckey->priv_key, BN_value_one()) < 0
517 || BN_cmp(eckey->priv_key, eckey->group->order) >= 0) {
527 * Check if generator * priv_key = pub_key
537 || eckey->priv_key == NULL) {
547 if (!EC_POINT_mul(eckey->group, point, eckey->priv_key, NULL, NULL, ctx)) {
587 if (eckey->priv_key != NULL) {
692 return key->priv_key;
695 int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key)
717 && key->group->meth->set_private(key, priv_key) == 0)
720 && key->meth->set_private(key, priv_key) == 0)
727 if (priv_key == NULL) {
728 BN_clear_free(key->priv_key);
729 key->priv_key = NULL;
771 tmp_key = BN_dup(priv_key);
783 BN_clear_free(key->priv_key);
784 key->priv_key = tmp_key;
918 if (eckey->priv_key == NULL)
927 if (BN_bn2binpad(eckey->priv_key, buf, buf_len) == -1) {
954 if (eckey->priv_key == NULL)
955 eckey->priv_key = BN_secure_new();
956 if (eckey->priv_key == NULL) {
960 if (BN_bin2bn(buf, len, eckey->priv_key) == NULL) {