Lines Matching refs:iv
123 static inline int crypto_ccm_check_iv(const u8 *iv) in crypto_ccm_check_iv() argument
126 if (1 > iv[0] || iv[0] > 7) in crypto_ccm_check_iv()
133 static int generate_b0(u8 *iv, unsigned int assoclen, unsigned int authsize, in generate_b0() argument
138 memcpy(b0, iv, 16); in generate_b0()
153 static int generate_pat(u8 *iv, in generate_pat() argument
169 memset(iv + 15 - iv[0], 0, iv[0] + 1); in generate_pat()
208 rc = generate_b0(iv, assoclen, authsize, nbytes, b0); in generate_pat()
327 u8 *iv, in ccm_nx_decrypt() argument
348 rc = generate_pat(iv, req, nx_ctx, authsize, nbytes, assoclen, in ccm_nx_decrypt()
367 rc = nx_build_sg_lists(nx_ctx, iv, req->dst, req->src, in ccm_nx_decrypt()
381 memcpy(iv, csbcpb->cpb.aes_ccm.out_ctr, AES_BLOCK_SIZE); in ccm_nx_decrypt()
405 u8 *iv, in ccm_nx_encrypt() argument
418 rc = generate_pat(iv, req, nx_ctx, authsize, nbytes, assoclen, in ccm_nx_encrypt()
436 rc = nx_build_sg_lists(nx_ctx, iv, req->dst, req->src, in ccm_nx_encrypt()
450 memcpy(iv, csbcpb->cpb.aes_ccm.out_ctr, AES_BLOCK_SIZE); in ccm_nx_encrypt()
481 u8 *iv = rctx->iv; in ccm4309_aes_nx_encrypt() local
483 iv[0] = 3; in ccm4309_aes_nx_encrypt()
484 memcpy(iv + 1, nx_ctx->priv.ccm.nonce, 3); in ccm4309_aes_nx_encrypt()
485 memcpy(iv + 4, req->iv, 8); in ccm4309_aes_nx_encrypt()
487 return ccm_nx_encrypt(req, iv, req->assoclen - 8); in ccm4309_aes_nx_encrypt()
494 rc = crypto_ccm_check_iv(req->iv); in ccm_aes_nx_encrypt()
498 return ccm_nx_encrypt(req, req->iv, req->assoclen); in ccm_aes_nx_encrypt()
505 u8 *iv = rctx->iv; in ccm4309_aes_nx_decrypt() local
507 iv[0] = 3; in ccm4309_aes_nx_decrypt()
508 memcpy(iv + 1, nx_ctx->priv.ccm.nonce, 3); in ccm4309_aes_nx_decrypt()
509 memcpy(iv + 4, req->iv, 8); in ccm4309_aes_nx_decrypt()
511 return ccm_nx_decrypt(req, iv, req->assoclen - 8); in ccm4309_aes_nx_decrypt()
518 rc = crypto_ccm_check_iv(req->iv); in ccm_aes_nx_decrypt()
522 return ccm_nx_decrypt(req, req->iv, req->assoclen); in ccm_aes_nx_decrypt()