Lines Matching refs:mpi_key
272 struct rsa_mpi_key *mpi_key = akcipher_tfm_ctx(tfm); in rsa_set_pub_key() local
277 rsa_free_mpi_key(mpi_key); in rsa_set_pub_key()
283 mpi_key->e = mpi_read_raw_data(raw_key.e, raw_key.e_sz); in rsa_set_pub_key()
284 if (!mpi_key->e) in rsa_set_pub_key()
287 mpi_key->n = mpi_read_raw_data(raw_key.n, raw_key.n_sz); in rsa_set_pub_key()
288 if (!mpi_key->n) in rsa_set_pub_key()
291 if (rsa_check_key_length(mpi_get_size(mpi_key->n) << 3)) { in rsa_set_pub_key()
292 rsa_free_mpi_key(mpi_key); in rsa_set_pub_key()
296 if (fips_enabled && rsa_check_exponent_fips(mpi_key->e)) { in rsa_set_pub_key()
297 rsa_free_mpi_key(mpi_key); in rsa_set_pub_key()
304 rsa_free_mpi_key(mpi_key); in rsa_set_pub_key()
311 struct rsa_mpi_key *mpi_key = akcipher_tfm_ctx(tfm); in rsa_set_priv_key() local
316 rsa_free_mpi_key(mpi_key); in rsa_set_priv_key()
322 mpi_key->d = mpi_read_raw_data(raw_key.d, raw_key.d_sz); in rsa_set_priv_key()
323 if (!mpi_key->d) in rsa_set_priv_key()
326 mpi_key->e = mpi_read_raw_data(raw_key.e, raw_key.e_sz); in rsa_set_priv_key()
327 if (!mpi_key->e) in rsa_set_priv_key()
330 mpi_key->n = mpi_read_raw_data(raw_key.n, raw_key.n_sz); in rsa_set_priv_key()
331 if (!mpi_key->n) in rsa_set_priv_key()
334 mpi_key->p = mpi_read_raw_data(raw_key.p, raw_key.p_sz); in rsa_set_priv_key()
335 if (!mpi_key->p) in rsa_set_priv_key()
338 mpi_key->q = mpi_read_raw_data(raw_key.q, raw_key.q_sz); in rsa_set_priv_key()
339 if (!mpi_key->q) in rsa_set_priv_key()
342 mpi_key->dp = mpi_read_raw_data(raw_key.dp, raw_key.dp_sz); in rsa_set_priv_key()
343 if (!mpi_key->dp) in rsa_set_priv_key()
346 mpi_key->dq = mpi_read_raw_data(raw_key.dq, raw_key.dq_sz); in rsa_set_priv_key()
347 if (!mpi_key->dq) in rsa_set_priv_key()
350 mpi_key->qinv = mpi_read_raw_data(raw_key.qinv, raw_key.qinv_sz); in rsa_set_priv_key()
351 if (!mpi_key->qinv) in rsa_set_priv_key()
354 if (rsa_check_key_length(mpi_get_size(mpi_key->n) << 3)) { in rsa_set_priv_key()
355 rsa_free_mpi_key(mpi_key); in rsa_set_priv_key()
359 if (fips_enabled && rsa_check_exponent_fips(mpi_key->e)) { in rsa_set_priv_key()
360 rsa_free_mpi_key(mpi_key); in rsa_set_priv_key()
367 rsa_free_mpi_key(mpi_key); in rsa_set_priv_key()