Lines Matching refs:cctx
516 EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
524 &cctx->ks.ks);
525 CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L,
526 &cctx->ks, (block128_f) ossl_aria_encrypt);
531 cctx->str = NULL;
532 cctx->key_set = 1;
535 memcpy(ctx->iv, iv, 15 - cctx->L);
536 cctx->iv_set = 1;
543 EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,c);
547 cctx->key_set = 0;
548 cctx->iv_set = 0;
549 cctx->L = 8;
550 cctx->M = 12;
551 cctx->tag_set = 0;
552 cctx->len_set = 0;
553 cctx->tls_aad_len = -1;
557 *(int *)ptr = 15 - cctx->L;
565 cctx->tls_aad_len = arg;
576 if (len < cctx->M)
578 len -= cctx->M;
584 return cctx->M;
600 cctx->L = arg;
608 cctx->tag_set = 1;
611 cctx->M = arg;
615 if (!EVP_CIPHER_CTX_is_encrypting(c) || !cctx->tag_set)
617 if (!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg))
619 cctx->tag_set = 0;
620 cctx->iv_set = 0;
621 cctx->len_set = 0;
628 if (cctx->ccm.key) {
629 if (cctx->ccm.key != &cctx->ks)
644 EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
645 CCM128_CONTEXT *ccm = &cctx->ccm;
648 if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M))
658 len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
659 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L,
664 cctx->tls_aad_len);
669 if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str)
672 if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M))
674 return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M;
676 if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, cctx->str)
679 if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
680 if (!CRYPTO_memcmp(tag, in + len, cctx->M))
692 EVP_ARIA_CCM_CTX *cctx = EVP_C_DATA(EVP_ARIA_CCM_CTX,ctx);
693 CCM128_CONTEXT *ccm = &cctx->ccm;
696 if (!cctx->key_set)
699 if (cctx->tls_aad_len >= 0)
706 if (!cctx->iv_set)
711 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))
713 cctx->len_set = 1;
717 if (!cctx->len_set && len)
724 if (!EVP_CIPHER_CTX_is_encrypting(ctx) && !cctx->tag_set)
728 if (!cctx->len_set) {
729 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len))
731 cctx->len_set = 1;
734 if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str)
737 cctx->tag_set = 1;
741 if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len,
742 cctx->str) :
745 if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) {
747 cctx->M))
753 cctx->iv_set = 0;
754 cctx->tag_set = 0;
755 cctx->len_set = 0;