Lines Matching refs:cipher
85 const EVP_CIPHER *cipher; in evp_cipher_param_to_asn1_ex() local
87 if (c == NULL || c->cipher == NULL) in evp_cipher_param_to_asn1_ex()
90 cipher = c->cipher; in evp_cipher_param_to_asn1_ex()
107 if (cipher->set_asn1_parameters != NULL) { in evp_cipher_param_to_asn1_ex()
108 ret = cipher->set_asn1_parameters(c, type); in evp_cipher_param_to_asn1_ex()
109 } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) { in evp_cipher_param_to_asn1_ex()
110 switch (EVP_CIPHER_get_mode(cipher)) { in evp_cipher_param_to_asn1_ex()
112 if (EVP_CIPHER_is_a(cipher, SN_id_smime_alg_CMS3DESwrap)) in evp_cipher_param_to_asn1_ex()
130 } else if (cipher->prov != NULL) { in evp_cipher_param_to_asn1_ex()
156 const EVP_CIPHER *cipher; in evp_cipher_asn1_to_param_ex() local
158 if (c == NULL || c->cipher == NULL) in evp_cipher_asn1_to_param_ex()
161 cipher = c->cipher; in evp_cipher_asn1_to_param_ex()
178 if (cipher->get_asn1_parameters != NULL) { in evp_cipher_asn1_to_param_ex()
179 ret = cipher->get_asn1_parameters(c, type); in evp_cipher_asn1_to_param_ex()
180 } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) { in evp_cipher_asn1_to_param_ex()
181 switch (EVP_CIPHER_get_mode(cipher)) { in evp_cipher_asn1_to_param_ex()
199 } else if (cipher->prov != NULL) { in evp_cipher_asn1_to_param_ex()
255 int EVP_CIPHER_get_type(const EVP_CIPHER *cipher) in EVP_CIPHER_get_type() argument
258 nid = EVP_CIPHER_get_nid(cipher); in EVP_CIPHER_get_type()
320 int evp_cipher_cache_constants(EVP_CIPHER *cipher) in evp_cipher_cache_constants() argument
345 ok = evp_do_ciph_getparams(cipher, params) > 0; in evp_cipher_cache_constants()
347 cipher->block_size = (int)blksz; in evp_cipher_cache_constants()
348 cipher->iv_len = (int)ivlen; in evp_cipher_cache_constants()
349 cipher->key_len = (int)keylen; in evp_cipher_cache_constants()
350 cipher->flags = mode; in evp_cipher_cache_constants()
352 cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER; in evp_cipher_cache_constants()
354 cipher->flags |= EVP_CIPH_CUSTOM_IV; in evp_cipher_cache_constants()
356 cipher->flags |= EVP_CIPH_FLAG_CTS; in evp_cipher_cache_constants()
358 cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK; in evp_cipher_cache_constants()
359 if (cipher->ccipher != NULL) in evp_cipher_cache_constants()
360 cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER; in evp_cipher_cache_constants()
362 cipher->flags |= EVP_CIPH_RAND_KEY; in evp_cipher_cache_constants()
364 cipher->flags |= EVP_CIPH_FLAG_ENC_THEN_MAC; in evp_cipher_cache_constants()
365 if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher), in evp_cipher_cache_constants()
367 cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1; in evp_cipher_cache_constants()
372 int EVP_CIPHER_get_block_size(const EVP_CIPHER *cipher) in EVP_CIPHER_get_block_size() argument
374 return (cipher == NULL) ? 0 : cipher->block_size; in EVP_CIPHER_get_block_size()
379 return (ctx == NULL) ? 0 : EVP_CIPHER_get_block_size(ctx->cipher); in EVP_CIPHER_CTX_get_block_size()
390 if (ctx == NULL || ctx->cipher == NULL) in EVP_Cipher()
393 if (ctx->cipher->prov != NULL) { in EVP_Cipher()
408 if (ctx->cipher->ccipher != NULL) in EVP_Cipher()
409 ret = ctx->cipher->ccipher(ctx->algctx, out, &outl, in EVP_Cipher()
414 ret = ctx->cipher->cupdate(ctx->algctx, out, &outl, in EVP_Cipher()
418 ret = ctx->cipher->cfinal(ctx->algctx, out, &outl, in EVP_Cipher()
424 return ctx->cipher->do_cipher(ctx, out, in, inl); in EVP_Cipher()
432 return ctx->cipher; in EVP_CIPHER_CTX_cipher()
440 return ctx->cipher; in EVP_CIPHER_CTX_get0_cipher()
445 EVP_CIPHER *cipher; in EVP_CIPHER_CTX_get1_cipher() local
447 if (ctx == NULL || ctx->cipher == NULL) in EVP_CIPHER_CTX_get1_cipher()
449 cipher = (EVP_CIPHER *)ctx->cipher; in EVP_CIPHER_CTX_get1_cipher()
450 if (!EVP_CIPHER_up_ref(cipher)) in EVP_CIPHER_CTX_get1_cipher()
452 return cipher; in EVP_CIPHER_CTX_get1_cipher()
460 unsigned long EVP_CIPHER_get_flags(const EVP_CIPHER *cipher) in EVP_CIPHER_get_flags() argument
462 return cipher == NULL ? 0 : cipher->flags; in EVP_CIPHER_get_flags()
490 int EVP_CIPHER_get_iv_length(const EVP_CIPHER *cipher) in EVP_CIPHER_get_iv_length() argument
492 return (cipher == NULL) ? 0 : cipher->iv_len; in EVP_CIPHER_get_iv_length()
497 if (ctx->cipher == NULL) in EVP_CIPHER_CTX_get_iv_length()
501 int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher); in EVP_CIPHER_CTX_get_iv_length()
505 if (ctx->cipher->get_ctx_params != NULL) { in EVP_CIPHER_CTX_get_iv_length()
508 rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_get_iv_length()
518 else if ((EVP_CIPHER_get_flags(ctx->cipher) in EVP_CIPHER_CTX_get_iv_length()
541 ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_get_tag_length()
555 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_original_iv()
572 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_iv()
586 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_iv_noconst()
598 return evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params) > 0; in EVP_CIPHER_CTX_get_updated_iv()
607 return evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params) > 0; in EVP_CIPHER_CTX_get_original_iv()
622 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_get_num()
634 ok = evp_do_ciph_ctx_setparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_set_num()
641 int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher) in EVP_CIPHER_get_key_length() argument
643 return cipher->key_len; in EVP_CIPHER_get_key_length()
648 if (ctx->cipher == NULL) in EVP_CIPHER_CTX_get_key_length()
651 if (ctx->key_len <= 0 && ctx->cipher->prov != NULL) { in EVP_CIPHER_CTX_get_key_length()
657 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params); in EVP_CIPHER_CTX_get_key_length()
675 int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher) in EVP_CIPHER_get_nid() argument
677 return (cipher == NULL) ? NID_undef : cipher->nid; in EVP_CIPHER_get_nid()
682 return EVP_CIPHER_get_nid(ctx->cipher); in EVP_CIPHER_CTX_get_nid()
685 int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name) in EVP_CIPHER_is_a() argument
687 if (cipher == NULL) in EVP_CIPHER_is_a()
689 if (cipher->prov != NULL) in EVP_CIPHER_is_a()
690 return evp_is_a(cipher->prov, cipher->name_id, NULL, name); in EVP_CIPHER_is_a()
691 return evp_is_a(NULL, 0, EVP_CIPHER_get0_name(cipher), name); in EVP_CIPHER_is_a()
694 int evp_cipher_get_number(const EVP_CIPHER *cipher) in evp_cipher_get_number() argument
696 return cipher->name_id; in evp_cipher_get_number()
699 const char *EVP_CIPHER_get0_name(const EVP_CIPHER *cipher) in EVP_CIPHER_get0_name() argument
701 if (cipher->type_name != NULL) in EVP_CIPHER_get0_name()
702 return cipher->type_name; in EVP_CIPHER_get0_name()
704 return OBJ_nid2sn(EVP_CIPHER_get_nid(cipher)); in EVP_CIPHER_get0_name()
710 const char *EVP_CIPHER_get0_description(const EVP_CIPHER *cipher) in EVP_CIPHER_get0_description() argument
712 if (cipher->description != NULL) in EVP_CIPHER_get0_description()
713 return cipher->description; in EVP_CIPHER_get0_description()
715 return OBJ_nid2ln(EVP_CIPHER_get_nid(cipher)); in EVP_CIPHER_get0_description()
721 int EVP_CIPHER_names_do_all(const EVP_CIPHER *cipher, in EVP_CIPHER_names_do_all() argument
725 if (cipher->prov != NULL) in EVP_CIPHER_names_do_all()
726 return evp_names_do_all(cipher->prov, cipher->name_id, fn, data); in EVP_CIPHER_names_do_all()
731 const OSSL_PROVIDER *EVP_CIPHER_get0_provider(const EVP_CIPHER *cipher) in EVP_CIPHER_get0_provider() argument
733 return cipher->prov; in EVP_CIPHER_get0_provider()
736 int EVP_CIPHER_get_mode(const EVP_CIPHER *cipher) in EVP_CIPHER_get_mode() argument
738 return EVP_CIPHER_get_flags(cipher) & EVP_CIPH_MODE; in EVP_CIPHER_get_mode()