Lines Matching refs:prsactx

85     PROV_RSA_CTX *prsactx =  OPENSSL_zalloc(sizeof(PROV_RSA_CTX));  in rsakem_newctx()  local
87 if (prsactx == NULL) in rsakem_newctx()
89 prsactx->libctx = PROV_LIBCTX_OF(provctx); in rsakem_newctx()
90 prsactx->op = KEM_OP_UNDEFINED; in rsakem_newctx()
92 return prsactx; in rsakem_newctx()
97 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_freectx() local
99 RSA_free(prsactx->rsa); in rsakem_freectx()
100 OPENSSL_free(prsactx); in rsakem_freectx()
123 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_init() local
125 if (prsactx == NULL || vrsa == NULL) in rsakem_init()
128 if (!ossl_rsa_check_key(prsactx->libctx, vrsa, operation)) in rsakem_init()
133 RSA_free(prsactx->rsa); in rsakem_init()
134 prsactx->rsa = vrsa; in rsakem_init()
136 return rsakem_set_ctx_params(prsactx, params); in rsakem_init()
170 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_set_ctx_params() local
174 if (prsactx == NULL) in rsakem_set_ctx_params()
187 prsactx->op = op; in rsakem_set_ctx_params()
244 static int rsasve_generate(PROV_RSA_CTX *prsactx, in rsasve_generate() argument
252 nlen = RSA_size(prsactx->rsa); in rsasve_generate()
271 if (!rsasve_gen_rand_bytes(prsactx->rsa, secret, nlen)) in rsasve_generate()
275 ret = RSA_public_encrypt(nlen, secret, out, prsactx->rsa, RSA_NO_PADDING); in rsasve_generate()
292 static int rsasve_recover(PROV_RSA_CTX *prsactx, in rsasve_recover() argument
299 nlen = RSA_size(prsactx->rsa); in rsasve_recover()
316 return (RSA_private_decrypt(inlen, in, out, prsactx->rsa, RSA_NO_PADDING) > 0); in rsasve_recover()
322 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_generate() local
324 switch (prsactx->op) { in rsakem_generate()
326 return rsasve_generate(prsactx, out, outlen, secret, secretlen); in rsakem_generate()
335 PROV_RSA_CTX *prsactx = (PROV_RSA_CTX *)vprsactx; in rsakem_recover() local
337 switch (prsactx->op) { in rsakem_recover()
339 return rsasve_recover(prsactx, out, outlen, in, inlen); in rsakem_recover()