Lines Matching defs:eckey
230 int EC_KEY_generate_key(EC_KEY *eckey)
239 return FIPS_ec_key_generate_key(eckey);
242 if (!eckey || !eckey->group) {
252 if (eckey->priv_key == NULL) {
257 priv_key = eckey->priv_key;
259 if (!EC_GROUP_get_order(eckey->group, order, ctx))
267 if (eckey->pub_key == NULL) {
268 pub_key = EC_POINT_new(eckey->group);
272 pub_key = eckey->pub_key;
274 if (!EC_POINT_mul(eckey->group, pub_key, priv_key, NULL, NULL, ctx))
277 eckey->priv_key = priv_key;
278 eckey->pub_key = pub_key;
285 if (pub_key != NULL && eckey->pub_key == NULL)
287 if (priv_key != NULL && eckey->priv_key == NULL)
294 int EC_KEY_check_key(const EC_KEY *eckey)
301 if (!eckey || !eckey->group || !eckey->pub_key) {
306 if (EC_POINT_is_at_infinity(eckey->group, eckey->pub_key)) {
313 if ((point = EC_POINT_new(eckey->group)) == NULL)
317 if (EC_POINT_is_on_curve(eckey->group, eckey->pub_key, ctx) <= 0) {
322 order = &eckey->group->order;
327 if (!EC_POINT_mul(eckey->group, point, NULL, eckey->pub_key, order, ctx)) {
331 if (!EC_POINT_is_at_infinity(eckey->group, point)) {
339 if (eckey->priv_key) {
340 if (BN_cmp(eckey->priv_key, order) >= 0) {
344 if (!EC_POINT_mul(eckey->group, point, eckey->priv_key,
349 if (EC_POINT_cmp(eckey->group, point, eckey->pub_key, ctx) != 0) {