Lines Matching refs:cctx
392 EVP_AES_CCM_CTX *cctx = ctx->cipher_data; in aesni_ccm_init_key() local
397 aesni_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); in aesni_ccm_init_key()
398 CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, in aesni_ccm_init_key()
399 &cctx->ks, (block128_f)aesni_encrypt); in aesni_ccm_init_key()
400 cctx->str = enc?(ccm128_f)aesni_ccm64_encrypt_blocks : in aesni_ccm_init_key()
402 cctx->key_set = 1; in aesni_ccm_init_key()
406 memcpy(ctx->iv, iv, 15 - cctx->L); in aesni_ccm_init_key()
407 cctx->iv_set = 1; in aesni_ccm_init_key()
1157 EVP_AES_CCM_CTX *cctx = c->cipher_data; in aes_ccm_ctrl() local
1161 cctx->key_set = 0; in aes_ccm_ctrl()
1162 cctx->iv_set = 0; in aes_ccm_ctrl()
1163 cctx->L = 8; in aes_ccm_ctrl()
1164 cctx->M = 12; in aes_ccm_ctrl()
1165 cctx->tag_set = 0; in aes_ccm_ctrl()
1166 cctx->len_set = 0; in aes_ccm_ctrl()
1174 cctx->L = arg; in aes_ccm_ctrl()
1184 cctx->tag_set = 1; in aes_ccm_ctrl()
1187 cctx->M = arg; in aes_ccm_ctrl()
1191 if (!c->encrypt || !cctx->tag_set) in aes_ccm_ctrl()
1193 if(!CRYPTO_ccm128_tag(&cctx->ccm, ptr, (size_t)arg)) in aes_ccm_ctrl()
1195 cctx->tag_set = 0; in aes_ccm_ctrl()
1196 cctx->iv_set = 0; in aes_ccm_ctrl()
1197 cctx->len_set = 0; in aes_ccm_ctrl()
1209 EVP_AES_CCM_CTX *cctx = ctx->cipher_data; in aes_ccm_init_key() local
1217 vpaes_set_encrypt_key(key, ctx->key_len*8, &cctx->ks); in aes_ccm_init_key()
1218 CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, in aes_ccm_init_key()
1219 &cctx->ks, (block128_f)vpaes_encrypt); in aes_ccm_init_key()
1220 cctx->str = NULL; in aes_ccm_init_key()
1221 cctx->key_set = 1; in aes_ccm_init_key()
1225 AES_set_encrypt_key(key, ctx->key_len * 8, &cctx->ks); in aes_ccm_init_key()
1226 CRYPTO_ccm128_init(&cctx->ccm, cctx->M, cctx->L, in aes_ccm_init_key()
1227 &cctx->ks, (block128_f)AES_encrypt); in aes_ccm_init_key()
1228 cctx->str = NULL; in aes_ccm_init_key()
1229 cctx->key_set = 1; in aes_ccm_init_key()
1233 memcpy(ctx->iv, iv, 15 - cctx->L); in aes_ccm_init_key()
1234 cctx->iv_set = 1; in aes_ccm_init_key()
1242 EVP_AES_CCM_CTX *cctx = ctx->cipher_data; in aes_ccm_cipher() local
1243 CCM128_CONTEXT *ccm = &cctx->ccm; in aes_ccm_cipher()
1245 if (!cctx->iv_set && !cctx->key_set) in aes_ccm_cipher()
1247 if (!ctx->encrypt && !cctx->tag_set) in aes_ccm_cipher()
1253 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L,len)) in aes_ccm_cipher()
1255 cctx->len_set = 1; in aes_ccm_cipher()
1259 if (!cctx->len_set && len) in aes_ccm_cipher()
1268 if (!cctx->len_set) in aes_ccm_cipher()
1270 if (CRYPTO_ccm128_setiv(ccm, ctx->iv, 15 - cctx->L, len)) in aes_ccm_cipher()
1272 cctx->len_set = 1; in aes_ccm_cipher()
1276 if (cctx->str ? CRYPTO_ccm128_encrypt_ccm64(ccm, in, out, len, in aes_ccm_cipher()
1277 cctx->str) : in aes_ccm_cipher()
1280 cctx->tag_set = 1; in aes_ccm_cipher()
1286 if (cctx->str ? !CRYPTO_ccm128_decrypt_ccm64(ccm, in, out, len, in aes_ccm_cipher()
1287 cctx->str) : in aes_ccm_cipher()
1291 if (CRYPTO_ccm128_tag(ccm, tag, cctx->M)) in aes_ccm_cipher()
1293 if (!memcmp(tag, ctx->buf, cctx->M)) in aes_ccm_cipher()
1299 cctx->iv_set = 0; in aes_ccm_cipher()
1300 cctx->tag_set = 0; in aes_ccm_cipher()
1301 cctx->len_set = 0; in aes_ccm_cipher()