Lines Matching refs:prsactx

86     PROV_RSA_CTX *prsactx;  in rsakem_newctx()  local
91 prsactx = OPENSSL_zalloc(sizeof(PROV_RSA_CTX)); in rsakem_newctx()
92 if (prsactx == NULL) in rsakem_newctx()
94 prsactx->libctx = PROV_LIBCTX_OF(provctx); in rsakem_newctx()
95 prsactx->op = KEM_OP_UNDEFINED; in rsakem_newctx()
96 OSSL_FIPS_IND_INIT(prsactx) in rsakem_newctx()
98 return prsactx; in rsakem_newctx()
103 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_freectx() local
105 RSA_free(prsactx->rsa); in rsakem_freectx()
106 OPENSSL_free(prsactx); in rsakem_freectx()
133 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_init() local
139 if (prsactx == NULL || vrsa == NULL) in rsakem_init()
146 RSA_free(prsactx->rsa); in rsakem_init()
147 prsactx->rsa = vrsa; in rsakem_init()
149 OSSL_FIPS_IND_SET_APPROVED(prsactx) in rsakem_init()
150 if (!rsakem_set_ctx_params(prsactx, params)) in rsakem_init()
153 if (!ossl_fips_ind_rsa_key_check(OSSL_FIPS_IND_GET(prsactx), in rsakem_init()
154 OSSL_FIPS_IND_SETTABLE0, prsactx->libctx, in rsakem_init()
155 prsactx->rsa, desc, protect)) in rsakem_init()
200 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_set_ctx_params() local
204 if (prsactx == NULL) in rsakem_set_ctx_params()
209 if (!OSSL_FIPS_IND_SET_CTX_PARAM(prsactx, OSSL_FIPS_IND_SETTABLE0, params, in rsakem_set_ctx_params()
219 prsactx->op = op; in rsakem_set_ctx_params()
277 static int rsasve_generate(PROV_RSA_CTX *prsactx, in rsasve_generate() argument
285 nlen = RSA_size(prsactx->rsa); in rsasve_generate()
315 if (!rsasve_gen_rand_bytes(prsactx->rsa, secret, nlen)) in rsasve_generate()
319 ret = RSA_public_encrypt(nlen, secret, out, prsactx->rsa, RSA_NO_PADDING); in rsasve_generate()
353 static int rsasve_recover(PROV_RSA_CTX *prsactx, in rsasve_recover() argument
361 nlen = RSA_size(prsactx->rsa); in rsasve_recover()
392 ret = RSA_private_decrypt(inlen, in, out, prsactx->rsa, RSA_NO_PADDING); in rsasve_recover()
401 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_generate() local
406 switch (prsactx->op) { in rsakem_generate()
408 return rsasve_generate(prsactx, out, outlen, secret, secretlen); in rsakem_generate()
417 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_recover() local
422 switch (prsactx->op) { in rsakem_recover()
424 return rsasve_recover(prsactx, out, outlen, in, inlen); in rsakem_recover()