Lines Matching refs:AES_BLOCK_SIZE
130 u8 dg[AES_BLOCK_SIZE];
185 while ((blocks = (walk.nbytes / AES_BLOCK_SIZE))) { in ecb_encrypt()
190 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in ecb_encrypt()
205 while ((blocks = (walk.nbytes / AES_BLOCK_SIZE))) { in ecb_decrypt()
210 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in ecb_decrypt()
223 while ((blocks = (walk->nbytes / AES_BLOCK_SIZE))) { in cbc_encrypt_walk()
228 err = skcipher_walk_done(walk, walk->nbytes % AES_BLOCK_SIZE); in cbc_encrypt_walk()
252 while ((blocks = (walk->nbytes / AES_BLOCK_SIZE))) { in cbc_decrypt_walk()
257 err = skcipher_walk_done(walk, walk->nbytes % AES_BLOCK_SIZE); in cbc_decrypt_walk()
278 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_encrypt()
288 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_encrypt()
289 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_encrypt()
296 cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_encrypt()
304 if (req->cryptlen == AES_BLOCK_SIZE) in cts_cbc_encrypt()
315 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_encrypt()
335 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2; in cts_cbc_decrypt()
345 if (req->cryptlen <= AES_BLOCK_SIZE) { in cts_cbc_decrypt()
346 if (req->cryptlen < AES_BLOCK_SIZE) in cts_cbc_decrypt()
353 cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_decrypt()
361 if (req->cryptlen == AES_BLOCK_SIZE) in cts_cbc_decrypt()
372 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE, in cts_cbc_decrypt()
413 blocks = walk.nbytes / AES_BLOCK_SIZE; in essiv_cbc_encrypt()
420 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in essiv_cbc_encrypt()
435 blocks = walk.nbytes / AES_BLOCK_SIZE; in essiv_cbc_decrypt()
442 err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE); in essiv_cbc_decrypt()
460 u8 buf[AES_BLOCK_SIZE]; in ctr_encrypt()
463 if (unlikely(nbytes < AES_BLOCK_SIZE)) in ctr_encrypt()
466 nbytes &= ~(AES_BLOCK_SIZE - 1); in ctr_encrypt()
473 tail = nbytes % (STRIDE * AES_BLOCK_SIZE); in ctr_encrypt()
474 if (tail > 0 && tail < AES_BLOCK_SIZE) in ctr_encrypt()
516 int tail = req->cryptlen % AES_BLOCK_SIZE; in xts_encrypt()
522 if (req->cryptlen < AES_BLOCK_SIZE) in xts_encrypt()
529 AES_BLOCK_SIZE) - 2; in xts_encrypt()
538 xts_blocks * AES_BLOCK_SIZE, in xts_encrypt()
546 for (first = 1; walk.nbytes >= AES_BLOCK_SIZE; first = 0) { in xts_encrypt()
550 nbytes &= ~(AES_BLOCK_SIZE - 1); in xts_encrypt()
567 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail, in xts_encrypt()
588 int tail = req->cryptlen % AES_BLOCK_SIZE; in xts_decrypt()
594 if (req->cryptlen < AES_BLOCK_SIZE) in xts_decrypt()
601 AES_BLOCK_SIZE) - 2; in xts_decrypt()
610 xts_blocks * AES_BLOCK_SIZE, in xts_decrypt()
618 for (first = 1; walk.nbytes >= AES_BLOCK_SIZE; first = 0) { in xts_decrypt()
622 nbytes &= ~(AES_BLOCK_SIZE - 1); in xts_decrypt()
639 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail, in xts_decrypt()
663 .cra_blocksize = AES_BLOCK_SIZE,
678 .cra_blocksize = AES_BLOCK_SIZE,
684 .ivsize = AES_BLOCK_SIZE,
700 .ivsize = AES_BLOCK_SIZE,
701 .chunksize = AES_BLOCK_SIZE,
716 .ivsize = AES_BLOCK_SIZE,
717 .chunksize = AES_BLOCK_SIZE,
727 .cra_blocksize = AES_BLOCK_SIZE,
733 .ivsize = AES_BLOCK_SIZE,
734 .walksize = 2 * AES_BLOCK_SIZE,
745 .cra_blocksize = AES_BLOCK_SIZE,
751 .ivsize = AES_BLOCK_SIZE,
752 .walksize = 2 * AES_BLOCK_SIZE,
762 .cra_blocksize = AES_BLOCK_SIZE,
768 .ivsize = AES_BLOCK_SIZE,
807 aes_ecb_encrypt(ctx->consts, (u8[AES_BLOCK_SIZE]){}, ctx->key.key_enc, in cmac_setkey()
820 static u8 const ks[3][AES_BLOCK_SIZE] = { in xcbc_setkey()
821 { [0 ... AES_BLOCK_SIZE - 1] = 0x1 }, in xcbc_setkey()
822 { [0 ... AES_BLOCK_SIZE - 1] = 0x2 }, in xcbc_setkey()
823 { [0 ... AES_BLOCK_SIZE - 1] = 0x3 }, in xcbc_setkey()
828 u8 key[AES_BLOCK_SIZE]; in xcbc_setkey()
847 memset(ctx->dg, 0, AES_BLOCK_SIZE); in mac_init()
866 in += (blocks - rem) * AES_BLOCK_SIZE; in mac_do_update()
875 crypto_xor(dg, in, AES_BLOCK_SIZE); in mac_do_update()
876 in += AES_BLOCK_SIZE; in mac_do_update()
892 if ((ctx->len % AES_BLOCK_SIZE) == 0 && in mac_update()
893 (ctx->len + len) > AES_BLOCK_SIZE) { in mac_update()
895 int blocks = len / AES_BLOCK_SIZE; in mac_update()
897 len %= AES_BLOCK_SIZE; in mac_update()
902 p += blocks * AES_BLOCK_SIZE; in mac_update()
905 ctx->len = AES_BLOCK_SIZE; in mac_update()
911 l = min(len, AES_BLOCK_SIZE - ctx->len); in mac_update()
913 if (l <= AES_BLOCK_SIZE) { in mac_update()
931 memcpy(out, ctx->dg, AES_BLOCK_SIZE); in cbcmac_final()
942 if (ctx->len != AES_BLOCK_SIZE) { in cmac_final()
944 consts += AES_BLOCK_SIZE; in cmac_final()
949 memcpy(out, ctx->dg, AES_BLOCK_SIZE); in cmac_final()
958 .base.cra_blocksize = AES_BLOCK_SIZE,
960 2 * AES_BLOCK_SIZE,
963 .digestsize = AES_BLOCK_SIZE,
973 .base.cra_blocksize = AES_BLOCK_SIZE,
975 2 * AES_BLOCK_SIZE,
978 .digestsize = AES_BLOCK_SIZE,
992 .digestsize = AES_BLOCK_SIZE,