Lines Matching refs:cipher

25     EVP_ASYM_CIPHER *cipher = NULL;
51 * Try to derive the supported asym cipher from |ctx->keymgmt|.
71 * 1. Do the normal asym cipher fetch, using the fetching data given by
73 * 2. Do the provider specific asym cipher fetch, from the same provider
77 * asym cipher, and try to export |ctx->pkey| to that keymgmt (when
93 EVP_ASYM_CIPHER_free(cipher);
98 cipher = EVP_ASYM_CIPHER_fetch(ctx->libctx, supported_ciph,
100 if (cipher != NULL)
101 tmp_prov = EVP_ASYM_CIPHER_get0_provider(cipher);
105 cipher =
108 if (cipher == NULL)
112 if (cipher == NULL)
118 * |ctx->pkey|, but from the provider of the asym cipher method, using
119 * the same property query as when fetching the asym cipher method.
136 EVP_ASYM_CIPHER_free(cipher);
144 ctx->op.ciph.cipher = cipher;
145 ctx->op.ciph.algctx = cipher->newctx(ossl_provider_ctx(cipher->prov));
154 if (cipher->encrypt_init == NULL) {
159 ret = cipher->encrypt_init(ctx->op.ciph.algctx, provkey, params);
162 if (cipher->decrypt_init == NULL) {
167 ret = cipher->decrypt_init(ctx->op.ciph.algctx, provkey, params);
246 ret = ctx->op.ciph.cipher->encrypt(ctx->op.ciph.algctx, out, outlen,
288 ret = ctx->op.ciph.cipher->decrypt(ctx->op.ciph.algctx, out, outlen,
304 EVP_ASYM_CIPHER *cipher = OPENSSL_zalloc(sizeof(EVP_ASYM_CIPHER));
306 if (cipher == NULL) {
311 cipher->lock = CRYPTO_THREAD_lock_new();
312 if (cipher->lock == NULL) {
314 OPENSSL_free(cipher);
317 cipher->prov = prov;
319 cipher->refcnt = 1;
321 return cipher;
329 EVP_ASYM_CIPHER *cipher = NULL;
333 if ((cipher = evp_asym_cipher_new(prov)) == NULL) {
338 cipher->name_id = name_id;
339 if ((cipher->type_name = ossl_algorithm_get1_first_name(algodef)) == NULL)
341 cipher->description = algodef->algorithm_description;
346 if (cipher->newctx != NULL)
348 cipher->newctx = OSSL_FUNC_asym_cipher_newctx(fns);
352 if (cipher->encrypt_init != NULL)
354 cipher->encrypt_init = OSSL_FUNC_asym_cipher_encrypt_init(fns);
358 if (cipher->encrypt != NULL)
360 cipher->encrypt = OSSL_FUNC_asym_cipher_encrypt(fns);
364 if (cipher->decrypt_init != NULL)
366 cipher->decrypt_init = OSSL_FUNC_asym_cipher_decrypt_init(fns);
370 if (cipher->decrypt != NULL)
372 cipher->decrypt = OSSL_FUNC_asym_cipher_decrypt(fns);
376 if (cipher->freectx != NULL)
378 cipher->freectx = OSSL_FUNC_asym_cipher_freectx(fns);
382 if (cipher->dupctx != NULL)
384 cipher->dupctx = OSSL_FUNC_asym_cipher_dupctx(fns);
387 if (cipher->get_ctx_params != NULL)
389 cipher->get_ctx_params
394 if (cipher->gettable_ctx_params != NULL)
396 cipher->gettable_ctx_params
401 if (cipher->set_ctx_params != NULL)
403 cipher->set_ctx_params
408 if (cipher->settable_ctx_params != NULL)
410 cipher->settable_ctx_params
425 * "cipher" functions: (encrypt_init, encrypt) or
435 return cipher;
437 EVP_ASYM_CIPHER_free(cipher);
441 void EVP_ASYM_CIPHER_free(EVP_ASYM_CIPHER *cipher)
445 if (cipher == NULL)
447 CRYPTO_DOWN_REF(&cipher->refcnt, &i, cipher->lock);
450 OPENSSL_free(cipher->type_name);
451 ossl_provider_free(cipher->prov);
452 CRYPTO_THREAD_lock_free(cipher->lock);
453 OPENSSL_free(cipher);
456 int EVP_ASYM_CIPHER_up_ref(EVP_ASYM_CIPHER *cipher)
460 CRYPTO_UP_REF(&cipher->refcnt, &ref, cipher->lock);
464 OSSL_PROVIDER *EVP_ASYM_CIPHER_get0_provider(const EVP_ASYM_CIPHER *cipher)
466 return cipher->prov;
489 int EVP_ASYM_CIPHER_is_a(const EVP_ASYM_CIPHER *cipher, const char *name)
491 return evp_is_a(cipher->prov, cipher->name_id, NULL, name);
494 int evp_asym_cipher_get_number(const EVP_ASYM_CIPHER *cipher)
496 return cipher->name_id;
499 const char *EVP_ASYM_CIPHER_get0_name(const EVP_ASYM_CIPHER *cipher)
501 return cipher->type_name;
504 const char *EVP_ASYM_CIPHER_get0_description(const EVP_ASYM_CIPHER *cipher)
506 return cipher->description;
510 void (*fn)(EVP_ASYM_CIPHER *cipher,
522 int EVP_ASYM_CIPHER_names_do_all(const EVP_ASYM_CIPHER *cipher,
526 if (cipher->prov != NULL)
527 return evp_names_do_all(cipher->prov, cipher->name_id, fn, data);