crypto: aesni - Add GCM_COMPLETE macro
authorDave Watson <davejwatson@fb.com>
Mon, 10 Dec 2018 19:57:49 +0000 (19:57 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 23 Dec 2018 03:52:42 +0000 (11:52 +0800)
Merge encode and decode tag calculations in GCM_COMPLETE macro.
Scatter/gather routines will call this once at the end of encryption
or decryption.

Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_avx-x86_64.S

index 2aa11c503bb925a0297fd9d74f20f03e0ab71552..8e9ae4b261188dd821f17e0aa1a3fbc3d3ff9a00 100644 (file)
@@ -510,6 +510,14 @@ _less_than_8_bytes_left\@:
         #############################
 
 _multiple_of_16_bytes\@:
+        GCM_COMPLETE \GHASH_MUL \REP
+.endm
+
+
+# GCM_COMPLETE Finishes update of tag of last partial block
+# Output: Authorization Tag (AUTH_TAG)
+# Clobbers rax, r10-r12, and xmm0, xmm1, xmm5-xmm15
+.macro GCM_COMPLETE GHASH_MUL REP
         mov     arg8, %r12                           # r12 = aadLen (number of bytes)
         shl     $3, %r12                             # convert into number of bits
         vmovd   %r12d, %xmm15                        # len(A) in xmm15