Lines Matching refs:cipher

84     const EVP_CIPHER *cipher = c->cipher;
89 * cipher->set_asn1_parameters is set. We know that this pointer
102 if (cipher->set_asn1_parameters != NULL) {
103 ret = cipher->set_asn1_parameters(c, type);
104 } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
105 switch (EVP_CIPHER_get_mode(cipher)) {
107 if (EVP_CIPHER_is_a(cipher, SN_id_smime_alg_CMS3DESwrap))
125 } else if (cipher->prov != NULL) {
175 const EVP_CIPHER *cipher = c->cipher;
180 * cipher->get_asn1_parameters is set. We know that this pointer
193 if (cipher->get_asn1_parameters != NULL) {
194 ret = cipher->get_asn1_parameters(c, type);
195 } else if ((EVP_CIPHER_get_flags(cipher) & EVP_CIPH_FLAG_CUSTOM_ASN1) == 0) {
196 switch (EVP_CIPHER_get_mode(cipher)) {
214 } else if (cipher->prov != NULL) {
275 /* Convert the various cipher NIDs and dummies to a proper OID NID */
276 int EVP_CIPHER_get_type(const EVP_CIPHER *cipher)
279 nid = EVP_CIPHER_get_nid(cipher);
341 int evp_cipher_cache_constants(EVP_CIPHER *cipher)
363 ok = evp_do_ciph_getparams(cipher, params) > 0;
365 cipher->block_size = blksz;
366 cipher->iv_len = ivlen;
367 cipher->key_len = keylen;
368 cipher->flags = mode;
370 cipher->flags |= EVP_CIPH_FLAG_AEAD_CIPHER;
372 cipher->flags |= EVP_CIPH_CUSTOM_IV;
374 cipher->flags |= EVP_CIPH_FLAG_CTS;
376 cipher->flags |= EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK;
377 if (cipher->ccipher != NULL)
378 cipher->flags |= EVP_CIPH_FLAG_CUSTOM_CIPHER;
380 cipher->flags |= EVP_CIPH_RAND_KEY;
381 if (OSSL_PARAM_locate_const(EVP_CIPHER_gettable_ctx_params(cipher),
383 cipher->flags |= EVP_CIPH_FLAG_CUSTOM_ASN1;
388 int EVP_CIPHER_get_block_size(const EVP_CIPHER *cipher)
390 return cipher->block_size;
395 return EVP_CIPHER_get_block_size(ctx->cipher);
406 if (ctx->cipher->prov != NULL) {
418 if (ctx->cipher->ccipher != NULL)
419 ret = ctx->cipher->ccipher(ctx->algctx, out, &outl,
424 ret = ctx->cipher->cupdate(ctx->algctx, out, &outl,
428 ret = ctx->cipher->cfinal(ctx->algctx, out, &outl,
434 return ctx->cipher->do_cipher(ctx, out, in, inl);
442 return ctx->cipher;
450 return ctx->cipher;
455 EVP_CIPHER *cipher;
459 cipher = (EVP_CIPHER *)ctx->cipher;
460 if (!EVP_CIPHER_up_ref(cipher))
462 return cipher;
470 unsigned long EVP_CIPHER_get_flags(const EVP_CIPHER *cipher)
472 return cipher->flags;
500 int EVP_CIPHER_get_iv_length(const EVP_CIPHER *cipher)
502 return cipher->iv_len;
508 int rv, len = EVP_CIPHER_get_iv_length(ctx->cipher);
512 if (ctx->cipher->get_ctx_params != NULL) {
515 rv = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
525 else if ((EVP_CIPHER_get_flags(ctx->cipher)
548 ret = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
562 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
579 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
593 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
605 return evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params) > 0;
614 return evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params) > 0;
629 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
641 ok = evp_do_ciph_ctx_setparams(ctx->cipher, ctx->algctx, params);
648 int EVP_CIPHER_get_key_length(const EVP_CIPHER *cipher)
650 return cipher->key_len;
660 ok = evp_do_ciph_ctx_getparams(ctx->cipher, ctx->algctx, params);
665 int EVP_CIPHER_get_nid(const EVP_CIPHER *cipher)
667 return cipher->nid;
672 return ctx->cipher->nid;
675 int EVP_CIPHER_is_a(const EVP_CIPHER *cipher, const char *name)
677 if (cipher == NULL)
679 if (cipher->prov != NULL)
680 return evp_is_a(cipher->prov, cipher->name_id, NULL, name);
681 return evp_is_a(NULL, 0, EVP_CIPHER_get0_name(cipher), name);
684 int evp_cipher_get_number(const EVP_CIPHER *cipher)
686 return cipher->name_id;
689 const char *EVP_CIPHER_get0_name(const EVP_CIPHER *cipher)
691 if (cipher->type_name != NULL)
692 return cipher->type_name;
694 return OBJ_nid2sn(EVP_CIPHER_get_nid(cipher));
700 const char *EVP_CIPHER_get0_description(const EVP_CIPHER *cipher)
702 if (cipher->description != NULL)
703 return cipher->description;
705 return OBJ_nid2ln(EVP_CIPHER_get_nid(cipher));
711 int EVP_CIPHER_names_do_all(const EVP_CIPHER *cipher,
715 if (cipher->prov != NULL)
716 return evp_names_do_all(cipher->prov, cipher->name_id, fn, data);
721 const OSSL_PROVIDER *EVP_CIPHER_get0_provider(const EVP_CIPHER *cipher)
723 return cipher->prov;
726 int EVP_CIPHER_get_mode(const EVP_CIPHER *cipher)
728 return EVP_CIPHER_get_flags(cipher) & EVP_CIPH_MODE;