Received: by 10.223.185.116 with SMTP id b49csp2742547wrg; Mon, 12 Feb 2018 15:13:20 -0800 (PST) X-Google-Smtp-Source: AH8x2266QCoT2ITiCJty0FFbxRZ+pf+ducRchN1I6coJytxe0l+Czj3vBEiuIgwsowqdc+3gRUFn X-Received: by 10.101.68.82 with SMTP id e18mr2945452pgq.329.1518477200127; Mon, 12 Feb 2018 15:13:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518477200; cv=none; d=google.com; s=arc-20160816; b=gYG/lWvhSYeHntU5UMqJJr+/Wh5NmcuZuJECpN9k0t+IbizV9bqq7QukaAfRuCWO/J BabuIXnihTOPNx9mQfQWvpncevQ/04+w7WJvLzGf2x2VEctFbmdKSL4OcfwLhKckWpj/ Bg51gRaaEuXp/nf82H833z/1oOcZDvNPsSi+pF3PijHn3tEH2MHEIQFyCeWqMMv6Krk2 3Kc+ilowIWGexlBY159doy2mFfz2pXxu8V3A8syaDNEMj4nZyt0mO8ZATJCexxsngOfz qKgTW8NYx0RUg5efEwyMapTlzH/K5j8UblMCD+3gHP5Xk6com0rSe14jZCtXml1pG850 kXuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=AWU/5dLNlx/HuYwu0A+k5N4/BWF4zGbSX4D9vTGBu+o=; b=ey39b0/QUGwmaC3fRvSAAyAqV8yN6mKCMY2exwaJ0lAxOP8FyI8OkO3lBbDC58wQsF QVTw2JLb90XrTgj8Z8omfiQ7b0MRwwcvAwRDZs1n15G+LEoKPEvoQc+GkbrCXcDiK53f PfyIoEX7dcFABEfjJfu3fhFrQwjfiur3WfA1pU3cvmcFSPkqxDOZ29heQ+hxPWPRTryO 1z/hgjsV1DXB0Ii+8o4VEe6QEeIKmmVUhcFSccsmJpbmGUUnNL51hBgGOb++jP6sTPdL RVlLwLQwUsR2EA+EINokoOVeyV8DW6Td9TX8R+1XinWUq2T8QUiBj1Bj5z+6MH9kFUYt qdtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VTfAY36W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p1-v6si2204719pls.795.2018.02.12.15.13.04; Mon, 12 Feb 2018 15:13:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VTfAY36W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbeBLXMW (ORCPT + 99 others); Mon, 12 Feb 2018 18:12:22 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:36357 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932376AbeBLXMU (ORCPT ); Mon, 12 Feb 2018 18:12:20 -0500 Received: by mail-pg0-f44.google.com with SMTP id j9so7451260pgv.3 for ; Mon, 12 Feb 2018 15:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=AWU/5dLNlx/HuYwu0A+k5N4/BWF4zGbSX4D9vTGBu+o=; b=VTfAY36Wcvu+DcUaNrYEwxM5b6PhZ3Yfr+zi4BfloZK04TVjXMwjyd0qps4npaSmE5 7XTbkCZ/d6+T9+e7HaHQdK8af0NCD6eh8inYg15Vb91dlFGcP8g0aZ3PUxxMgDdho+zk 4CppVjNO1fjDiPz4Dl/uY5NAhaUgK6z+r71n3BzbMeGPns79jem5BY5Q5Ns1uF1zoM2k 6Gb7yp/ARilv9Rwe8iA4yrOPm3+f/h2p9YGOXXi3bhZUJBWe/b287aoEvtQL917ECLB2 bJ3T0kAU8c4o3sLxzc7lAT98fzIDJ9lcRutFidgzU6EOyan9IjXz6rgylO2xsfwJsMLp BsaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=AWU/5dLNlx/HuYwu0A+k5N4/BWF4zGbSX4D9vTGBu+o=; b=m3e6N8yr+5agfhoPywpm3IbY9jKjG4SW6pVpWYs3odQ8APonFLeWRG7w3MiTg07Vb/ 2IRHa7wtLiBPvWCjS5yZkqUWK/gff5/jcGi075MEIr36SzYRdAAh7MJtXZUAnZJzRrqW FV81afcD/gq6fs07SGusR+X/Ym4mafbfs83ohV3BR7I4OLE6pNdhQk9QYlHiFWqP55i+ SAOrgE+7SgxRRoCSf9uCONiwkmt39b76nNvVbIr0ddHzO7J9zLHkFcl3n2gBQpiQxVgC TYLcGdYRe80mhfjOtayM7hCbxN2DcoaonXSd6pM7qlono13LURjAiJQ7+DRCme/SZ0XX wqWw== X-Gm-Message-State: APf1xPAPNV25vNbR9R3+RRZn3Po1pwIVmk4jU3DXl0hrAa26c/bI65IH wfVd//nmgTxtzmi6iCZPg8StwR6Lt0hfQg== X-Received: by 10.99.49.84 with SMTP id x81mr10342936pgx.371.1518477138777; Mon, 12 Feb 2018 15:12:18 -0800 (PST) Received: from js-desktop.svl.corp.google.com ([2620:15c:2cb:1:cdad:b4d5:21d1:e91e]) by smtp.gmail.com with ESMTPSA id 10sm11298892pfo.69.2018.02.12.15.12.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 15:12:18 -0800 (PST) Subject: Re: [PATCH 14/14] x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather To: Dave Watson , Herbert Xu , Steffen Klassert , linux-crypto@vger.kernel.org Cc: "David S. Miller" , Hannes Frederic Sowa , Tim Chen , Sabrina Dubroca , linux-kernel@vger.kernel.org, Stephan Mueller , Ilya Lesokhin References: <20180212195128.GA61087@davejwatson-mba.local> From: Junaid Shahid Organization: Google Message-ID: Date: Mon, 12 Feb 2018 15:12:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180212195128.GA61087@davejwatson-mba.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dave, On 02/12/2018 11:51 AM, Dave Watson wrote: > +static int gcmaes_encrypt_sg(struct aead_request *req, unsigned int assoclen, > + u8 *hash_subkey, u8 *iv, void *aes_ctx) > > +static int gcmaes_decrypt_sg(struct aead_request *req, unsigned int assoclen, > + u8 *hash_subkey, u8 *iv, void *aes_ctx) These two functions are almost identical. Wouldn't it be better to combine them into a single encrypt/decrypt function, similar to what you have done for the assembly macros? > + if (((struct crypto_aes_ctx *)aes_ctx)->key_length != AES_KEYSIZE_128 || > + aesni_gcm_enc_tfm == aesni_gcm_enc) { Shouldn't we also include a check for the buffer length being less than AVX_GEN2_OPTSIZE? AVX will not be used in that case either. Thanks, Junaid