- pshufd \$`1<<6`,$iv1,$inout5
- por $ivec,$inout2
- por $ivec,$inout3
- xorps $rndkey0,$inout0
- por $ivec,$inout4
- por $ivec,$inout5
-
- # inline _aesni_encrypt6 and interleave last rounds
- # with own code...
-
- pxor $rndkey0,$inout1
- aesenc $rndkey1,$inout0
- lea 32($key_),$key
- pxor $rndkey0,$inout2
- aesenc $rndkey1,$inout1
- movdqa .Lincrement32(%rip),$iv1
- pxor $rndkey0,$inout3
- aesenc $rndkey1,$inout2
- movdqa (%rsp),$iv0
- pxor $rndkey0,$inout4
- aesenc $rndkey1,$inout3
- pxor $rndkey0,$inout5
- $movkey ($key),$rndkey0
- dec $rounds
- aesenc $rndkey1,$inout4
- aesenc $rndkey1,$inout5
- jmp .Lctr32_enc_loop6_enter
-.align 16
-.Lctr32_enc_loop6:
- aesenc $rndkey1,$inout0
- aesenc $rndkey1,$inout1
- dec $rounds
- aesenc $rndkey1,$inout2
- aesenc $rndkey1,$inout3
- aesenc $rndkey1,$inout4
- aesenc $rndkey1,$inout5
-.Lctr32_enc_loop6_enter:
- $movkey 16($key),$rndkey1
- aesenc $rndkey0,$inout0
- aesenc $rndkey0,$inout1
- lea 32($key),$key
- aesenc $rndkey0,$inout2
- aesenc $rndkey0,$inout3
- aesenc $rndkey0,$inout4
- aesenc $rndkey0,$inout5
- $movkey ($key),$rndkey0
- jnz .Lctr32_enc_loop6
-
- aesenc $rndkey1,$inout0
- paddd $iv1,$iv0 # increment counter vector
- aesenc $rndkey1,$inout1
- paddd 0x10(%rsp),$iv1
- aesenc $rndkey1,$inout2
- movdqa $iv0,0x00(%rsp) # save counter vector
- aesenc $rndkey1,$inout3
- movdqa $iv1,0x10(%rsp)
- aesenc $rndkey1,$inout4
- pshufb $bswap_mask,$iv0 # byte swap
- aesenc $rndkey1,$inout5
- pshufb $bswap_mask,$iv1
-
- aesenclast $rndkey0,$inout0
- movups ($inp),$in0 # load input
- aesenclast $rndkey0,$inout1
- movups 0x10($inp),$in1
- aesenclast $rndkey0,$inout2
- movups 0x20($inp),$in2
- aesenclast $rndkey0,$inout3
- movups 0x30($inp),$in3
- aesenclast $rndkey0,$inout4
- movups 0x40($inp),$rndkey1
- aesenclast $rndkey0,$inout5
- movups 0x50($inp),$rndkey0
- lea 0x60($inp),$inp
-
- xorps $inout0,$in0 # xor
- pshufd \$`3<<6`,$iv0,$inout0
- xorps $inout1,$in1
- pshufd \$`2<<6`,$iv0,$inout1
- movups $in0,($out) # store output
- xorps $inout2,$in2
- pshufd \$`1<<6`,$iv0,$inout2
- movups $in1,0x10($out)
- xorps $inout3,$in3
- movups $in2,0x20($out)
- xorps $inout4,$rndkey1
- movups $in3,0x30($out)
- xorps $inout5,$rndkey0
- movups $rndkey1,0x40($out)
- movups $rndkey0,0x50($out)
- lea 0x60($out),$out
+ movdqa $rndkey0,$inout0
+ movdqa $rndkey0,$inout1
+ pxor $ivec,$inout0
+ paddb $one,$ivec
+ movdqa $rndkey0,$inout2
+ aesenc $rndkey1,$inout0
+ pxor $ivec,$inout1
+ paddb $one,$ivec
+ lea 32($key_),$key
+ movdqa $rndkey0,$inout3
+ aesenc $rndkey1,$inout1
+ pxor $ivec,$inout2
+ paddb $one,$ivec
+ movdqa $rndkey0,$inout4
+ aesenc $rndkey1,$inout2
+ pxor $ivec,$inout3
+ paddb $one,$ivec
+ movdqa $rndkey0,$inout5
+ aesenc $rndkey1,$inout3
+ pxor $ivec,$inout4
+ paddb $one,$ivec
+ movdqa $rndkey0,$inout6
+ aesenc $rndkey1,$inout4
+ pxor $ivec,$inout5
+ paddb $one,$ivec
+ movdqa $rndkey0,$inout7
+ aesenc $rndkey1,$inout5
+ pxor $ivec,$inout6
+ paddb $one,$ivec
+ $movkey ($key),$rndkey0
+ aesenc $rndkey1,$inout6
+ pxor $ivec,$inout7
+ paddb $one,$ivec
+ dec $rounds
+ aesenc $rndkey1,$inout7
+ $movkey 16($key),$rndkey1
+ movups ($inp),$in0 # load input
+ movups 0x10($inp),$in1
+ movups 0x20($inp),$in2
+ movups 0x30($inp),$in3
+
+ call .Lenc_loop8_enter
+
+ xorps $in0,$inout0 # xor
+ movups 0x40($inp),$in0
+ xorps $in1,$inout1
+ movups 0x50($inp),$in1
+ xorps $in2,$inout2
+ movups 0x60($inp),$in2
+ xorps $in3,$inout3
+ movups 0x70($inp),$in3
+ lea 0x80($inp),$inp
+ xorps $in0,$inout4
+ movups $inout0,($out) # store output
+ xorps $in1,$inout5
+ movups $inout1,0x10($out)
+ xorps $in2,$inout6
+ movups $inout2,0x20($out)
+ xorps $in3,$inout7
+ movups $inout3,0x30($out)
+ movups $inout4,0x40($out)
+ movups $inout5,0x50($out)
+ movups $inout6,0x60($out)
+ movups $inout7,0x70($out)
+ lea 0x80($out),$out
+
+ $movkey ($key_),$rndkey0