Lines Matching refs:rsa

146     RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey);  in pkey_rsa_sign()  local
165 ret = RSA_sign_ASN1_OCTET_STRING(0, tbs, tbslen, sig, &sltmp, rsa); in pkey_rsa_sign()
171 if ((size_t)RSA_size(rsa) < tbslen + 1) { in pkey_rsa_sign()
182 sig, rsa, RSA_X931_PADDING); in pkey_rsa_sign()
186 tbs, tbslen, sig, &sltmp, rsa); in pkey_rsa_sign()
193 if (!RSA_padding_add_PKCS1_PSS_mgf1(rsa, in pkey_rsa_sign()
198 ret = RSA_private_encrypt(RSA_size(rsa), rctx->tbuf, in pkey_rsa_sign()
199 sig, rsa, RSA_NO_PADDING); in pkey_rsa_sign()
204 ret = RSA_private_encrypt(tbslen, tbs, sig, rsa, rctx->pad_mode); in pkey_rsa_sign()
223 RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey); in pkey_rsa_verifyrecover() local
229 ret = RSA_public_decrypt(siglen, sig, rctx->tbuf, rsa, in pkey_rsa_verifyrecover()
248 sig, siglen, rsa); in pkey_rsa_verifyrecover()
256 ret = RSA_public_decrypt(siglen, sig, rout, rsa, rctx->pad_mode); in pkey_rsa_verifyrecover()
274 RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey); in pkey_rsa_verify() local
281 sig, siglen, rsa); in pkey_rsa_verify()
299 rsa, RSA_NO_PADDING); in pkey_rsa_verify()
302 ret = RSA_verify_PKCS1_PSS_mgf1(rsa, tbs, in pkey_rsa_verify()
315 rsa, rctx->pad_mode); in pkey_rsa_verify()
338 RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey); in pkey_rsa_encrypt() local
341 int klen = RSA_size(rsa); in pkey_rsa_encrypt()
350 ret = RSA_public_encrypt(klen, rctx->tbuf, out, rsa, RSA_NO_PADDING); in pkey_rsa_encrypt()
352 ret = RSA_public_encrypt(inlen, in, out, rsa, rctx->pad_mode); in pkey_rsa_encrypt()
372 RSA *rsa = (RSA *)EVP_PKEY_get0_RSA(ctx->pkey); in pkey_rsa_decrypt() local
377 ret = RSA_private_decrypt(inlen, in, rctx->tbuf, rsa, RSA_NO_PADDING); in pkey_rsa_decrypt()
391 ret = RSA_private_decrypt(inlen, in, out, rsa, pad_mode); in pkey_rsa_decrypt()
765 static int rsa_set_pss_param(RSA *rsa, EVP_PKEY_CTX *ctx) in rsa_set_pss_param() argument
774 rsa->pss = ossl_rsa_pss_params_create(rctx->md, rctx->mgf1md, in rsa_set_pss_param()
777 if (rsa->pss == NULL) in rsa_set_pss_param()
784 RSA *rsa = NULL; in pkey_rsa_keygen() local
794 rsa = RSA_new(); in pkey_rsa_keygen()
795 if (rsa == NULL) in pkey_rsa_keygen()
800 RSA_free(rsa); in pkey_rsa_keygen()
807 ret = RSA_generate_multi_prime_key(rsa, rctx->nbits, rctx->primes, in pkey_rsa_keygen()
810 if (ret > 0 && !rsa_set_pss_param(rsa, ctx)) { in pkey_rsa_keygen()
811 RSA_free(rsa); in pkey_rsa_keygen()
815 EVP_PKEY_assign(pkey, ctx->pmeth->pkey_id, rsa); in pkey_rsa_keygen()
817 RSA_free(rsa); in pkey_rsa_keygen()
868 const RSA *rsa; in pkey_pss_init() local
877 rsa = EVP_PKEY_get0_RSA(ctx->pkey); in pkey_pss_init()
879 if (rsa->pss == NULL) in pkey_pss_init()
882 if (!ossl_rsa_pss_get_param(rsa->pss, &md, &mgf1md, &min_saltlen)) in pkey_pss_init()
891 max_saltlen = RSA_size(rsa) - md_size; in pkey_pss_init()
892 if ((RSA_bits(rsa) & 0x7) == 1) in pkey_pss_init()