src/sig/ec_key.c
int ec_structured_key_pair_import_from_buf(ec_key_pair *kp,
					   const ec_params *params,
					   const u8 *priv_key_buf,
					   u8 priv_key_buf_len,
					   const u8 *pub_key_buf,
					   u8 pub_key_buf_len,
					   ec_sig_alg_type ec_key_alg)
{
	int ret;

	ret = ec_structured_pub_key_import_from_buf(&kp->pub_key, params,
						    pub_key_buf,
						    pub_key_buf_len,
						    ec_key_alg);
	if (ret) {
		return -1;
	}

	ret = ec_structured_priv_key_import_from_buf(&kp->priv_key, params,
						     priv_key_buf,
						     priv_key_buf_len,
						     ec_key_alg);
	if (ret) {
		return -1;
	}

	return 0;
}
/*
 * Import a key pair from a two structured key buffer (private and public one)
 * The function does not verify the coherency between private and public parts.
 */
Import a key pair from a two structured key buffer (private and public one)
The function does not verify the coherency between private and public parts.
Import a key pair from a two structured key buffer ( private and public one ) The function does not verify the coherency between private and public parts .
int ec_structured_key_pair_import_from_buf(ec_key_pair *kp,
					   const ec_params *params,
					   const u8 *priv_key_buf,
					   u8 priv_key_buf_len,
					   const u8 *pub_key_buf,
					   u8 pub_key_buf_len,
					   ec_sig_alg_type ec_key_alg)
{
	int ret;
	ret = ec_structured_pub_key_import_from_buf(&kp->pub_key, params,
						    pub_key_buf,
						    pub_key_buf_len,
						    ec_key_alg);
	if (ret) {
		return -1;
	}
	ret = ec_structured_priv_key_import_from_buf(&kp->priv_key, params,
						     priv_key_buf,
						     priv_key_buf_len,
						     ec_key_alg);
	if (ret) {
		return -1;
	}
	return 0;
}
int ec_structured_key_pair_import_from_buf ( ec_key_pair * kp , const ec_params * params , const u8 * priv_key_buf , u8 priv_key_buf_len , const u8 * pub_key_buf , u8 pub_key_buf_len , ec_sig_alg_type ec_key_alg ) { int ret ; ret = ec_structured_pub_key_import_from_buf ( & kp -> pub_key , params , pub_key_buf , pub_key_buf_len , ec_key_alg ) ; if ( ret ) { return -1 ; } ret = ec_structured_priv_key_import_from_buf ( & kp -> priv_key , params , priv_key_buf , priv_key_buf_len , ec_key_alg ) ; if ( ret ) { return -1 ; } return 0 ; }
Import a key pair from a two structured key buffer (private and public one)
 The function does not verify the coherency between private and public parts.
Import a key pair from a two structured key buffer ( private and public one ) The function does not verify the coherency between private and public parts .