Lines Matching +full:sub +full:- +full:blocks
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Implement AES algorithm in Intel AES-NI instructions.
5 * The white paper of AES-NI instructions can be downloaded from:
6 * http://softwarecommunity.intel.com/isn/downloads/intelavx/AES-Instructions-Set_WP.pdf
13 * Added RFC4106 AES-GCM support for 128-bit keys under the AEAD
14 * interface for 64-bit kernels.
30 #include <asm/nospec-branch.h>
248 # Clobbers rax, r10-r13 and xmm0-xmm6, %xmm13
274 # Clobbers rax, r10-r13, and xmm0-xmm15
283 sub %r11, %arg5 # sub partial block data used
286 and $-16, %r13 # %r13 = %r13 - (%r13 mod 16)
288 # Encrypt/Decrypt first few blocks
298 sub $48, %r13
303 sub $32, %r13
308 sub $16, %r13
315 # Main loop - Encrypt/Decrypt remaining blocks
319 sub $64, %r13
326 sub $64, %r13
359 sub $16, %r11
365 sub %r13, %r11
369 # adjust the shuffle mask pointer to be able to shift 16-r13 bytes
371 sub %r13, %r12
374 # shift right 16-r13 bytes
379 sub %r13, %r12
386 # get the appropriate mask to mask out top 16-r13 bytes of xmm0
387 pand %xmm1, %xmm0 # mask out top 16-r13 bytes of xmm0
417 sub $8, %r13
422 sub $1, %r13
429 # Clobbers rax, r10-r12, and xmm0, xmm1, xmm5-xmm15
471 sub $8, %r11
479 sub $4, %r11
504 * Input: A and B (128-bits each, bit-reflected)
569 sub $8, \DLEN
585 mov -1(\DPTR, \DLEN, 1), %al
593 # clobbers r10-11, xmm14
606 pshufb %xmm14, \TMP7 # byte-reflect the AAD data
610 sub $16, %r11
622 pshufb %xmm14, \TMP7 # byte-reflect the AAD data
631 # PARTIAL_BLOCK: Handles encryption/decryption and the tag partial blocks
635 # Clobbers rax, r10, r12, r13, xmm0-6, xmm9-13
640 je .L_partial_block_done_\@ # Leave Macro if no partial blocks
662 # r16-r13 is the number of bytes in plaintext mod 16)
674 sub $16, %r10
678 sub %r10, %r12
681 movdqu ALL_F-SHIFT_MASK(%r12), %xmm1
710 sub $16, %r10
714 sub %r10, %r12
717 movdqu ALL_F-SHIFT_MASK(%r12), %xmm1
751 sub %r12, %r13
765 sub $8, %r13
770 sub $1, %r13
779 * encrypt the initial num_initial_blocks blocks and apply ghash on
793 # start AES for num_initial_blocks blocks
813 shr $2,%eax # 128->4, 192->6, 256->8
814 add $5,%eax # 128->9, 192->11, 256->13
822 sub $1,%eax
845 # apply GHASH on num_initial_blocks blocks
868 * Precomputations for HashKey parallel with encryption of first 4 blocks.
909 shr $2,%eax # 128->4, 192->6, 256->8
910 sub $4,%eax # 128->0, 192->2, 256->4
919 sub $1,%eax
971 * encrypt 4 blocks at a time
972 * ghash the 4 previously encrypted ciphertext blocks
1096 shr $2,%eax # 128->4, 192->6, 256->8
1097 sub $4,%eax # 128->0, 192->2, 256->4
1106 sub $1,%eax
1179 * decrypt 4 blocks at a time
1180 * ghash the 4 previously decrypted ciphertext blocks
1304 shr $2,%eax # 128->4, 192->6, 256->8
1305 sub $4,%eax # 128->0, 192->2, 256->4
1314 sub $1,%eax
1390 /* GHASH the last 4 ciphertext blocks. */
1456 # TMP6:XMMDst holds the result of the accumulated carry-less multiplications
1496 shr $2,%eax # 128->4, 192->6, 256->8
1497 add $5,%eax # 128->9, 192->11, 256->13
1504 sub $1,%eax
1514 * u8 *out, // Plaintext output. Encrypt in-place is allowed.
1517 * u8 *iv, // Pre-counter block j0: 4 byte salt (from Security Associat…
1519 * // concatenated with 0x00000001. 16-byte aligned pointer.
1520 * u8 *hash_subkey, // H, the Hash sub key input. Data starts on a 16-byte bound…
1531 * keys are pre-expanded and aligned to 16 bytes. we are using the first
1537 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1539 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1542 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1544 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1558 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1560 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1561 * | 32-bit Sequence Number (A0) |
1562 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1564 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1566 * AAD Format with 32-bit Sequence Number
1574 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1576 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1578 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1579 * | 64-bit Extended Sequence Number {A1,A0} |
1581 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1583 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1585 * AAD Format with 64-bit Extended Sequence Number
1605 * u8 *out, // Ciphertext output. Encrypt in-place is allowed.
1608 * u8 *iv, // Pre-counter block j0: 4 byte salt (from Security Associ…
1610 * // concatenated with 0x00000001. 16-byte aligned pointer.
1611 * u8 *hash_subkey, // H, the Hash sub key input. Data starts on a 16-byte bou…
1621 * keys are pre-expanded and aligned to 16 bytes. we are using the
1628 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1630 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1633 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1635 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1649 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1651 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1652 * | 32-bit Sequence Number (A0) |
1653 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1655 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1657 * AAD Format with 32-bit Sequence Number
1665 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1667 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1668 * | 64-bit Extended Sequence Number {A1,A0} |
1670 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1672 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1674 * AAD Format with 64-bit Extended Sequence Number
1693 * u8 *iv, // Pre-counter block j0: 4 byte salt (from Security Assoc…
1695 * // concatenated with 0x00000001. 16-byte aligned pointer.
1696 * u8 *hash_subkey, // H, the Hash sub key input. Data starts on a 16-byte bo…
1711 * u8 *out, // Ciphertext output. Encrypt in-place is allowed.
1726 * u8 *out, // Ciphertext output. Encrypt in-place is allowed.
1913 sub $0x10, TKEYP
1919 lea 240-16(TKEYP), UKEYP
1926 sub $0x10, UKEYP
1983 movaps -0x60(TKEYP), KEY
1985 movaps -0x50(TKEYP), KEY
1989 movaps -0x40(TKEYP), KEY
1991 movaps -0x30(TKEYP), KEY
1995 movaps -0x20(TKEYP), KEY
1997 movaps -0x10(TKEYP), KEY
2049 movaps -0x60(TKEYP), KEY
2054 movaps -0x50(TKEYP), KEY
2061 movaps -0x40(TKEYP), KEY
2066 movaps -0x30(TKEYP), KEY
2073 movaps -0x20(TKEYP), KEY
2078 movaps -0x10(TKEYP), KEY
2173 movaps -0x60(TKEYP), KEY
2175 movaps -0x50(TKEYP), KEY
2179 movaps -0x40(TKEYP), KEY
2181 movaps -0x30(TKEYP), KEY
2185 movaps -0x20(TKEYP), KEY
2187 movaps -0x10(TKEYP), KEY
2239 movaps -0x60(TKEYP), KEY
2244 movaps -0x50(TKEYP), KEY
2251 movaps -0x40(TKEYP), KEY
2256 movaps -0x30(TKEYP), KEY
2263 movaps -0x20(TKEYP), KEY
2268 movaps -0x10(TKEYP), KEY
2349 sub $64, LEN
2361 sub $16, LEN
2410 sub $64, LEN
2422 sub $16, LEN
2464 sub $16, LEN
2541 sub $64, LEN
2556 sub $16, LEN
2596 sub $16, LEN
2600 sub LEN, IVP
2654 sub $16, LEN
2658 sub LEN, IVP
2793 sub $64, LEN
2808 sub $16, LEN
2871 sub $64, LEN
2938 sub $16, LEN
2952 sub $16, LEN
2965 sub $16, OUTP
2980 sub LEN, IVP
3028 sub $16, LEN
3031 sub $64, LEN
3103 sub $16, LEN
3142 sub LEN, IVP