From patchwork Fri May 8 08:46:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 6363451 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 19ECA9F32B for ; Fri, 8 May 2015 08:46:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D1D220211 for ; Fri, 8 May 2015 08:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6064420204 for ; Fri, 8 May 2015 08:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751732AbbEHIqe (ORCPT ); Fri, 8 May 2015 04:46:34 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:33728 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbbEHIqa (ORCPT ); Fri, 8 May 2015 04:46:30 -0400 Received: by wief7 with SMTP id f7so31633052wie.0 for ; Fri, 08 May 2015 01:46:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AOzma7tFLUz78V9OTv5Rs6oUGiGOHjWGf9OhvDUK1rM=; b=kEuZRWro2D1+whleOcNnEAVzNFTTjncVuVOudoCMMwKZy02Wnbq1/CPWAzv0InNmVd fkV+DrtDxSACzKeCXFx+nKGM34w4ih1JOnkoElK3eQ8pEFERCePfVphPPDjYO9NfATj0 xUB1aSdIX8fSQTA497U8IX6KGtuOBhD2SmRM6KJon+A8W9pXKEbGkNAvJJIVQJ5/3CnE r6cKngB7JjzVr+seLoQzdPdZJVVdASzzCMpuZtshPBTRN7JI9f+Rc1VWonwfc1QYsw1Q pcDl62kVpvLpCrmk8fKNrHmS4/Nf4hhhHhnL54hF7iKxfaYo4C5iahk7t84xLx9OX325 ARnQ== X-Gm-Message-State: ALoCoQmymHscOvfv+wsPcBlVoVjyi3VyqoSXR2D8n9mcnATgwvmkN4ChEv8FYcIwa251KfferdJT X-Received: by 10.180.208.42 with SMTP id mb10mr4086620wic.80.1431074788859; Fri, 08 May 2015 01:46:28 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id g14sm7276309wjs.47.2015.05.08.01.46.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 May 2015 01:46:28 -0700 (PDT) From: Ard Biesheuvel To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel Subject: [PATCH 2/2] crypto: arm/aes - streamline AES-192 code path Date: Fri, 8 May 2015 10:46:22 +0200 Message-Id: <1431074782-22141-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431074782-22141-1-git-send-email-ard.biesheuvel@linaro.org> References: <1431074782-22141-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- arch/arm/crypto/aes-ce-core.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/crypto/aes-ce-core.S b/arch/arm/crypto/aes-ce-core.S index 8cfa468ee570..987aa632c9f0 100644 --- a/arch/arm/crypto/aes-ce-core.S +++ b/arch/arm/crypto/aes-ce-core.S @@ -101,15 +101,14 @@ \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 @@ -122,8 +121,8 @@ * 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