src/sig/ec_key.c
int ec_pub_key_import_from_buf(ec_pub_key *pub_key, const ec_params *params,
			       const u8 *pub_key_buf, u8 pub_key_buf_len,
			       ec_sig_alg_type ec_key_alg)
{
	int ret;

	/* Import the projective point */
	ret = prj_pt_import_from_buf(&(pub_key->y),
				     pub_key_buf, pub_key_buf_len,
				     (ec_shortw_crv_src_t)&(params->ec_curve));
	if (ret < 0) {
		return -1;
	}

	/* Set key type and pointer to EC params */
	pub_key->key_type = ec_key_alg;
	pub_key->params = (const ec_params *)params;
	pub_key->magic = PUB_KEY_MAGIC;

	return 0;
}
/*
 * Import a public key from a buffer with known EC parameters and algorithm
 * Note that no sanity check is performed  by the function to verify key
 * is valid for params. Also note that no deep copy of pointed params is
 * performed.
 */
Import a public key from a buffer with known EC parameters and algorithm
Note that no sanity check is performed  by the function to verify key
is valid for params. Also note that no deep copy of pointed params is
performed.
Import a public key from a buffer with known EC parameters and algorithm Note that no sanity check is performed by the function to verify key is valid for params . Also note that no deep copy of pointed params is performed .
int ec_pub_key_import_from_buf(ec_pub_key *pub_key, const ec_params *params,
			       const u8 *pub_key_buf, u8 pub_key_buf_len,
			       ec_sig_alg_type ec_key_alg)
{
	int ret;
	ret = prj_pt_import_from_buf(&(pub_key->y),
				     pub_key_buf, pub_key_buf_len,
				     (ec_shortw_crv_src_t)&(params->ec_curve));
	if (ret < 0) {
		return -1;
	}
	pub_key->key_type = ec_key_alg;
	pub_key->params = (const ec_params *)params;
	pub_key->magic = PUB_KEY_MAGIC;
	return 0;
}
int ec_pub_key_import_from_buf ( ec_pub_key * pub_key , const ec_params * params , const u8 * pub_key_buf , u8 pub_key_buf_len , ec_sig_alg_type ec_key_alg ) { int ret ; ret = prj_pt_import_from_buf ( & ( pub_key -> y ) , pub_key_buf , pub_key_buf_len , ( ec_shortw_crv_src_t ) & ( params -> ec_curve ) ) ; if ( ret < 0 ) { return -1 ; } pub_key -> key_type = ec_key_alg ; pub_key -> params = ( const ec_params * ) params ; pub_key -> magic = PUB_KEY_MAGIC ; return 0 ; }
Import a public key from a buffer with known EC parameters and algorithm
 Note that no sanity check is performed  by the function to verify key
 is valid for params.
Import a public key from a buffer with known EC parameters and algorithm Note that no sanity check is performed by the function to verify key is valid for params .
/* Import the projective point */ /* Set key type and pointer to EC params */