crypto: arm/aes - streamline AES-192 code path
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 8 May 2015 08:46:22 +0000 (10:46 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 11 May 2015 07:08:01 +0000 (15:08 +0800)
This trims off a couple of instructions of the total size of the
core AES transform by reordering the final branch in the AES-192
code path with the rounds that are performed regardless of whether
the branch is taken or not. Other than the slight size reduction,
this has no performance benefit.

Fix up a comment regarding the prototype of this function while
we're at it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/arm/crypto/aes-ce-core.S

index 8cfa468ee570b0bd0f2bb800fa1f7f21b66edaf6..987aa632c9f060abff0e38e0c3c2a85eaedeeee1 100644 (file)
        \dround         q10, q11
        blo             0f                      @ AES-128: 10 rounds
        vld1.8          {q10-q11}, [ip]!
-       beq             1f                      @ AES-192: 12 rounds
        \dround         q12, q13
+       beq             1f                      @ AES-192: 12 rounds
        vld1.8          {q12-q13}, [ip]
        \dround         q10, q11
 0:     \fround         q12, q13, q14
        bx              lr
 
-1:     \dround         q12, q13
-       \fround         q10, q11, q14
+1:     \fround         q10, q11, q14
        bx              lr
        .endm
 
         *   q2        : third in/output block (_3x version only)
         *   q8        : first round key
         *   q9        : secound round key
-        *   ip        : address of 3rd round key
         *   q14       : final round key
+        *   r2        : address of round key array
         *   r3        : number of rounds
         */
        .align          6