From patchwork Thu Feb 6 12:25:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 24253 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24904206FF for ; Thu, 6 Feb 2014 12:25:11 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w8sf3577381qac.0 for ; Thu, 06 Feb 2014 04:25:10 -0800 (PST) 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=3Bjng8O371taIxN8/5GHdvUgACCtKkx0Dv86z/XKx3M=; b=mlYimpUuhHzKclEi9aWRt7P93AHxfTU9mL1jnBDA3Xzy7eL4mZ3twAYF3z8opJCPzX hiugHWKU4LfmkC3NW3Zub9UKL/ggaDNAIYTWc1DdEidK4W/bkyayHSgK1snc8lnhvm3l k6cdN/0h/usGyolTp2Sf8eEDot5XT3jy/QR6qoK7pVhBLgAYdQtAwKdLoDEDJDCWFYKb h98h4RTKneMuLrfe73hLay8E7mzfue4wcu/BSZdWegwIn0VGWVH0BCXJXjWFU4J5e6I7 6HwkBp/RRdW2sw1/HBcjs3OVsAknSI+X0qHeJIKmxXdMOQJXFxfnIiVqc6m+FhmY1Q2Q P1AA== X-Gm-Message-State: ALoCoQkf2lpYeigtNYR+h2V/6LMF429Hhv8T2Ohi4YWK1GeKgNlaMH4NPtMDrPyb2jEMt3Vb+Muv X-Received: by 10.59.7.2 with SMTP id cy2mr1617133ved.9.1391689510226; Thu, 06 Feb 2014 04:25:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.102 with SMTP id a93ls532147qga.33.gmail; Thu, 06 Feb 2014 04:25:10 -0800 (PST) X-Received: by 10.52.229.133 with SMTP id sq5mr52150vdc.45.1391689510176; Thu, 06 Feb 2014 04:25:10 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id eo4si204597vdb.17.2014.02.06.04.25.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 04:25:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so1374569vcb.3 for ; Thu, 06 Feb 2014 04:25:10 -0800 (PST) X-Received: by 10.220.191.134 with SMTP id dm6mr5677100vcb.16.1391689510091; Thu, 06 Feb 2014 04:25:10 -0800 (PST) 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.220.174.196 with SMTP id u4csp8398vcz; Thu, 6 Feb 2014 04:25:09 -0800 (PST) X-Received: by 10.68.29.72 with SMTP id i8mr12342381pbh.116.1391689508922; Thu, 06 Feb 2014 04:25:08 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pg10si923480pbb.354.2014.02.06.04.25.08; Thu, 06 Feb 2014 04:25:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756084AbaBFMZG (ORCPT + 1 other); Thu, 6 Feb 2014 07:25:06 -0500 Received: from mail-we0-f170.google.com ([74.125.82.170]:34716 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756204AbaBFMZF (ORCPT ); Thu, 6 Feb 2014 07:25:05 -0500 Received: by mail-we0-f170.google.com with SMTP id w62so1246205wes.29 for ; Thu, 06 Feb 2014 04:25:04 -0800 (PST) X-Received: by 10.180.97.37 with SMTP id dx5mr6589373wib.53.1391689504368; Thu, 06 Feb 2014 04:25:04 -0800 (PST) Received: from ards-macbook-pro.local (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id dd3sm2028920wjb.9.2014.02.06.04.25.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 04:25:03 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: davem@davemloft.net, herbert@gondor.apana.org.au, jussi.kivilinna@iki.fi, Ard Biesheuvel Subject: [RFC PATCH 1/3] crypto: add interleave option to cipher_alg Date: Thu, 6 Feb 2014 13:25:02 +0100 Message-Id: <1391689504-28160-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1391689504-28160-1-git-send-email-ard.biesheuvel@linaro.org> References: <1391689504-28160-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=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , Many ciphers perform better when allowed to operate on data sizes that are larger than the natural block size of the algorithm. This patch adds a struct member .cia_interleave which holds the preferred number of blocks processed in a single invocation. The invocations themselves should occur through .cia_enc_interleave and .cia_dec_interleave. Signed-off-by: Ard Biesheuvel --- include/linux/crypto.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/crypto.h b/include/linux/crypto.h index b92eadf92d72..4f09a10a4efa 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h @@ -252,6 +252,10 @@ struct cipher_alg { unsigned int keylen); void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); + + unsigned int cia_interleave; + void (*cia_enc_interleave)(struct crypto_tfm *tfm, u8 *d, const u8 *s); + void (*cia_dec_interleave)(struct crypto_tfm *tfm, u8 *d, const u8 *s); }; struct compress_alg {