Lines Matching defs:key

304 	/* Ensure public key is on the elliptic curve. */
310 /* Ensure public key multiplied by the order is the point at infinity. */
325 * If the private key is present, ensure that the private key multiplied
326 * by the generator matches the public key.
356 EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y)
363 if (key == NULL || key->group == NULL || x == NULL || y == NULL) {
378 if ((point = EC_POINT_new(key->group)) == NULL)
381 if (!EC_POINT_set_affine_coordinates(key->group, point, x, y, ctx))
383 if (!EC_POINT_get_affine_coordinates(key->group, point, tx, ty, ctx))
394 if (!EC_KEY_set_public_key(key, point))
396 if (EC_KEY_check_key(key) == 0)
411 EC_KEY_get0_group(const EC_KEY *key)
413 return key->group;
418 EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group)
420 if (key->meth->set_group != NULL &&
421 key->meth->set_group(key, group) == 0)
423 EC_GROUP_free(key->group);
424 key->group = EC_GROUP_dup(group);
425 return (key->group == NULL) ? 0 : 1;
430 EC_KEY_get0_private_key(const EC_KEY *key)
432 return key->priv_key;
437 EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key)
439 if (key->meth->set_private != NULL &&
440 key->meth->set_private(key, priv_key) == 0)
443 BN_free(key->priv_key);
444 if ((key->priv_key = BN_dup(priv_key)) == NULL)
452 EC_KEY_get0_public_key(const EC_KEY *key)
454 return key->pub_key;
459 EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key)
461 if (key->meth->set_public != NULL &&
462 key->meth->set_public(key, pub_key) == 0)
465 EC_POINT_free(key->pub_key);
466 if ((key->pub_key = EC_POINT_dup(pub_key, key->group)) == NULL)
474 EC_KEY_get_enc_flags(const EC_KEY *key)
476 return key->enc_flag;
481 EC_KEY_set_enc_flags(EC_KEY *key, unsigned int flags)
483 key->enc_flag = flags;
488 EC_KEY_get_conv_form(const EC_KEY *key)
490 return key->conv_form;
495 EC_KEY_set_conv_form(EC_KEY *key, point_conversion_form_t cform)
497 key->conv_form = cform;
498 if (key->group != NULL)
499 EC_GROUP_set_point_conversion_form(key->group, cform);
504 EC_KEY_set_asn1_flag(EC_KEY *key, int flag)
506 if (key->group != NULL)
507 EC_GROUP_set_asn1_flag(key->group, flag);
512 EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx)
514 if (key->group == NULL)
521 EC_KEY_get_flags(const EC_KEY *key)
523 return key->flags;
528 EC_KEY_set_flags(EC_KEY *key, int flags)
530 key->flags |= flags;
535 EC_KEY_clear_flags(EC_KEY *key, int flags)
537 key->flags &= ~flags;
542 EC_KEY_get_method(const EC_KEY *key)
544 return key->meth;
549 EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth)
551 void (*finish)(EC_KEY *key) = key->meth->finish;
554 finish(key);
556 key->meth = meth;
558 return meth->init(key);
623 int (*init)(EC_KEY *key),
624 void (*finish)(EC_KEY *key),
626 int (*set_group)(EC_KEY *key, const EC_GROUP *grp),
627 int (*set_private)(EC_KEY *key, const BIGNUM *priv_key),
628 int (*set_public)(EC_KEY *key, const EC_POINT *pub_key))
640 EC_KEY_METHOD_set_keygen(EC_KEY_METHOD *meth, int (*keygen)(EC_KEY *key))
687 int (**pinit)(EC_KEY *key),
688 void (**pfinish)(EC_KEY *key),
690 int (**pset_group)(EC_KEY *key, const EC_GROUP *grp),
691 int (**pset_private)(EC_KEY *key, const BIGNUM *priv_key),
692 int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key))
711 int (**pkeygen)(EC_KEY *key))