Lines Matching refs:lmd_res

23 static TEE_Result get_tee_result(int lmd_res)  in get_tee_result()  argument
25 switch (lmd_res) { in get_tee_result()
103 int lmd_res = 0; in rsa_complete_from_key_pair() local
123 lmd_res = mbedtls_rsa_deduce_primes(&rsa->N, &rsa->E, &rsa->D, in rsa_complete_from_key_pair()
125 if (lmd_res) { in rsa_complete_from_key_pair()
127 -lmd_res); in rsa_complete_from_key_pair()
131 lmd_res = mbedtls_rsa_deduce_crt(&rsa->P, &rsa->Q, &rsa->D, in rsa_complete_from_key_pair()
133 if (lmd_res) { in rsa_complete_from_key_pair()
135 -lmd_res); in rsa_complete_from_key_pair()
148 return get_tee_result(lmd_res); in rsa_complete_from_key_pair()
289 int lmd_res = 0; in sw_crypto_acipher_gen_rsa_key() local
304 lmd_res = mbedtls_rsa_gen_key(&rsa, mbedtls_ctr_drbg_random, &rngctx, in sw_crypto_acipher_gen_rsa_key()
307 if (lmd_res != 0) { in sw_crypto_acipher_gen_rsa_key()
308 res = get_tee_result(lmd_res); in sw_crypto_acipher_gen_rsa_key()
344 int lmd_res = 0; in sw_crypto_acipher_rsanopad_encrypt() local
367 lmd_res = mbedtls_rsa_public(&rsa, buf, buf); in sw_crypto_acipher_rsanopad_encrypt()
368 if (lmd_res != 0) { in sw_crypto_acipher_rsanopad_encrypt()
369 FMSG("mbedtls_rsa_public() returned 0x%x", -lmd_res); in sw_crypto_acipher_rsanopad_encrypt()
370 res = get_tee_result(lmd_res); in sw_crypto_acipher_rsanopad_encrypt()
409 int lmd_res = 0; in sw_crypto_acipher_rsanopad_decrypt() local
428 lmd_res = mbedtls_rsa_private(&rsa, mbd_rand, NULL, buf, buf); in sw_crypto_acipher_rsanopad_decrypt()
429 if (lmd_res != 0) { in sw_crypto_acipher_rsanopad_decrypt()
430 FMSG("mbedtls_rsa_private() returned 0x%x", -lmd_res); in sw_crypto_acipher_rsanopad_decrypt()
431 res = get_tee_result(lmd_res); in sw_crypto_acipher_rsanopad_decrypt()
472 int lmd_res = 0; in sw_crypto_acipher_rsaes_decrypt() local
538 lmd_res = pk_info->decrypt_func(&ctx, src, src_len, buf, &blen, in sw_crypto_acipher_rsaes_decrypt()
540 if (lmd_res != 0) { in sw_crypto_acipher_rsaes_decrypt()
541 FMSG("decrypt_func() returned 0x%x", -lmd_res); in sw_crypto_acipher_rsaes_decrypt()
542 res = get_tee_result(lmd_res); in sw_crypto_acipher_rsaes_decrypt()
580 int lmd_res = 0; in sw_crypto_acipher_rsaes_encrypt() local
636 lmd_res = pk_info->encrypt_func(&ctx, src, src_len, dst, dst_len, in sw_crypto_acipher_rsaes_encrypt()
638 if (lmd_res != 0) { in sw_crypto_acipher_rsaes_encrypt()
639 FMSG("encrypt_func() returned 0x%x", -lmd_res); in sw_crypto_acipher_rsaes_encrypt()
640 res = get_tee_result(lmd_res); in sw_crypto_acipher_rsaes_encrypt()
664 int lmd_res = 0; in sw_crypto_acipher_rsassa_sign() local
740 lmd_res = pk_info->sign_func(&ctx, md_algo, msg, msg_len, sig, in sw_crypto_acipher_rsassa_sign()
742 if (lmd_res != 0) { in sw_crypto_acipher_rsassa_sign()
743 FMSG("sign_func failed, returned 0x%x", -lmd_res); in sw_crypto_acipher_rsassa_sign()
744 res = get_tee_result(lmd_res); in sw_crypto_acipher_rsassa_sign()
769 int lmd_res = 0; in sw_crypto_acipher_rsassa_verify() local
855 lmd_res = pk_info->verify_func(&ctx, md_algo, msg, msg_len, in sw_crypto_acipher_rsassa_verify()
857 if (!lmd_res) in sw_crypto_acipher_rsassa_verify()
858 FTMN_SET_CHECK_RES_FROM_CALL(&ftmn, FTMN_INCR0, lmd_res); in sw_crypto_acipher_rsassa_verify()
860 if (lmd_res != 0) { in sw_crypto_acipher_rsassa_verify()
861 FMSG("verify_func failed, returned 0x%x", -lmd_res); in sw_crypto_acipher_rsassa_verify()