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: 48162 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4ACA421550 for ; Fri, 8 May 2015 08:46:43 +0000 (UTC) Received: by layy10 with SMTP id y10sf21128098lay.0 for ; Fri, 08 May 2015 01:46:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=WVDWyXOprxXmdF443UAxhYbJgt3XyhEaW8/ve+yBp5U=; b=Y9Y+ydQ2y9PTCBljpiX0g/T4UzndDBgNc9kAF9quwlFXxDI0NqwaT3R8RMFcM0W+w2 v6kquV5FFyBIafS11nl+7RbKBuHZ6twLLZoNtgFZwPbJmeEkKAxShZSbNfsaNLvzbKZH sQ+htLFf7y+Az3Ie1uNBNLEfi18WMy7127oM40B1zPofvNeBie3h/VLH/Uak7TxYuxBu lKsd29A161S5GynRrB+ouc5/fLJRJO0Sun/ErUbN/xN1V+iWIomZD6iGm1wJy6axbJRe wZ1qO6IhmFeORIPTpnylqQ7bB0n3pxj4HIzd0KMD09casRYbGIeAqRmo3BTi0aHFfwfT cauw== X-Gm-Message-State: ALoCoQmnKaxSwJmAwYppBFDnZTHJk0pMChGr20Qhx6M6lTuAR26bHo1XXhobys9Lg7SHKqpKqNRe X-Received: by 10.194.5.229 with SMTP id v5mr1528994wjv.0.1431074802311; Fri, 08 May 2015 01:46:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.9 with SMTP id 9ls352957laq.89.gmail; Fri, 08 May 2015 01:46:42 -0700 (PDT) X-Received: by 10.112.185.100 with SMTP id fb4mr2071221lbc.79.1431074802151; Fri, 08 May 2015 01:46:42 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id du6si2872098lbc.117.2015.05.08.01.46.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 01:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by laat2 with SMTP id t2so48006605laa.1 for ; Fri, 08 May 2015 01:46:42 -0700 (PDT) X-Received: by 10.112.140.231 with SMTP id rj7mr2033807lbb.76.1431074801965; Fri, 08 May 2015 01:46:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp321652lbb; Fri, 8 May 2015 01:46:41 -0700 (PDT) X-Received: by 10.66.116.132 with SMTP id jw4mr4832164pab.10.1431074797116; Fri, 08 May 2015 01:46:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1si6279231pdf.43.2015.05.08.01.46.36 for ; Fri, 08 May 2015 01:46:37 -0700 (PDT) Received-SPF: none (google.com: linux-crypto-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; 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-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: list List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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