Lines Matching refs:len

83                              size_t len, const ARIA_KEY *key,  in aria_cbc_encrypt()  argument
88 CRYPTO_cbc128_encrypt(in, out, len, key, ivec, in aria_cbc_encrypt()
91 CRYPTO_cbc128_decrypt(in, out, len, key, ivec, in aria_cbc_encrypt()
176 const unsigned char *in, size_t len) in aria_ctr_cipher() argument
186 CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, in aria_ctr_cipher()
356 unsigned int len = in aria_gcm_ctrl() local
360 if (len < EVP_GCM_TLS_EXPLICIT_IV_LEN) in aria_gcm_ctrl()
362 len -= EVP_GCM_TLS_EXPLICIT_IV_LEN; in aria_gcm_ctrl()
365 if (len < EVP_GCM_TLS_TAG_LEN) in aria_gcm_ctrl()
367 len -= EVP_GCM_TLS_TAG_LEN; in aria_gcm_ctrl()
369 EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] = len >> 8; in aria_gcm_ctrl()
370 EVP_CIPHER_CTX_buf_noconst(c)[arg - 1] = len & 0xff; in aria_gcm_ctrl()
403 const unsigned char *in, size_t len) in aria_gcm_tls_cipher() argument
410 || len < (EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN)) in aria_gcm_tls_cipher()
427 len -= EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN; in aria_gcm_tls_cipher()
430 if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len)) in aria_gcm_tls_cipher()
432 out += len; in aria_gcm_tls_cipher()
435 rv = len + EVP_GCM_TLS_EXPLICIT_IV_LEN + EVP_GCM_TLS_TAG_LEN; in aria_gcm_tls_cipher()
438 if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len)) in aria_gcm_tls_cipher()
444 if (CRYPTO_memcmp(EVP_CIPHER_CTX_buf_noconst(ctx), in + len, in aria_gcm_tls_cipher()
446 OPENSSL_cleanse(out, len); in aria_gcm_tls_cipher()
449 rv = len; in aria_gcm_tls_cipher()
459 const unsigned char *in, size_t len) in aria_gcm_cipher() argument
468 return aria_gcm_tls_cipher(ctx, out, in, len); in aria_gcm_cipher()
474 if (CRYPTO_gcm128_aad(&gctx->gcm, in, len)) in aria_gcm_cipher()
477 if (CRYPTO_gcm128_encrypt(&gctx->gcm, in, out, len)) in aria_gcm_cipher()
480 if (CRYPTO_gcm128_decrypt(&gctx->gcm, in, out, len)) in aria_gcm_cipher()
483 return len; in aria_gcm_cipher()
567 uint16_t len = in aria_ccm_ctrl() local
571 if (len < EVP_CCM_TLS_EXPLICIT_IV_LEN) in aria_ccm_ctrl()
573 len -= EVP_CCM_TLS_EXPLICIT_IV_LEN; in aria_ccm_ctrl()
576 if (len < cctx->M) in aria_ccm_ctrl()
578 len -= cctx->M; in aria_ccm_ctrl()
580 EVP_CIPHER_CTX_buf_noconst(c)[arg - 2] = len >> 8; in aria_ccm_ctrl()
581 EVP_CIPHER_CTX_buf_noconst(c)[arg - 1] = len & 0xff; in aria_ccm_ctrl()
642 const unsigned char *in, size_t len) in aria_ccm_tls_cipher() argument
648 if (out != in || len < (EVP_CCM_TLS_EXPLICIT_IV_LEN + (size_t)cctx->M)) in aria_ccm_tls_cipher()
658 len -= EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M; in aria_ccm_tls_cipher()
660 len)) in aria_ccm_tls_cipher()
669 if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str) in aria_ccm_tls_cipher()
670 : CRYPTO_ccm128_encrypt(ccm, in, out, len)) in aria_ccm_tls_cipher()
672 if (!CRYPTO_ccm128_tag(ccm, out + len, cctx->M)) in aria_ccm_tls_cipher()
674 return len + EVP_CCM_TLS_EXPLICIT_IV_LEN + cctx->M; in aria_ccm_tls_cipher()
676 if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, cctx->str) in aria_ccm_tls_cipher()
677 : !CRYPTO_ccm128_decrypt(ccm, in, out, len)) { in aria_ccm_tls_cipher()
680 if (!CRYPTO_memcmp(tag, in + len, cctx->M)) in aria_ccm_tls_cipher()
681 return len; in aria_ccm_tls_cipher()
684 OPENSSL_cleanse(out, len); in aria_ccm_tls_cipher()
690 const unsigned char *in, size_t len) in aria_ccm_cipher() argument
700 return aria_ccm_tls_cipher(ctx, out, in, len); in aria_ccm_cipher()
711 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) in aria_ccm_cipher()
714 return len; in aria_ccm_cipher()
717 if (!cctx->len_set && len) in aria_ccm_cipher()
719 CRYPTO_ccm128_aad(ccm, in, len); in aria_ccm_cipher()
720 return len; in aria_ccm_cipher()
729 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) in aria_ccm_cipher()
734 if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, cctx->str) in aria_ccm_cipher()
735 : CRYPTO_ccm128_encrypt(ccm, in, out, len)) in aria_ccm_cipher()
738 return len; in aria_ccm_cipher()
741 if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, in aria_ccm_cipher()
743 !CRYPTO_ccm128_decrypt(ccm, in, out, len)) { in aria_ccm_cipher()
748 rv = len; in aria_ccm_cipher()
752 OPENSSL_cleanse(out, len); in aria_ccm_cipher()