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