From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61748ECE58E for ; Thu, 17 Oct 2019 15:29:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34F1820872 for ; Thu, 17 Oct 2019 15:29:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rtG7U/WF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407699AbfJQP3C (ORCPT ); Thu, 17 Oct 2019 11:29:02 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36512 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407690AbfJQP3C (ORCPT ); Thu, 17 Oct 2019 11:29:02 -0400 Received: by mail-wm1-f68.google.com with SMTP id m18so3013256wmc.1 for ; Thu, 17 Oct 2019 08:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ekt2r633krBIKdm2MRWn1/pbuY6S29TraTxsvnoK4k=; b=rtG7U/WFEJB937Z+UVa7zX93QaONAQY6vMOSjaE/oYZkhh4E4IlI7dU+lRGEsJwSyA mymkOhBUkVE6YLDzZhDWJIWv/XRTly2XbhE+BioypJNcpOJW7FBP2z/j7nHOhQecV+fu fL2/XPHmaAkSk3IaJA+V050VgvfGv2HtmATwlaUVKV6+ePESSqHNCk62XsACKWvn+edL HkANTtvyN4Wfo62Boe8Nclhv5FwClad+EPHthVIPdHYQKxQMh4TQjTITGGS0ARd5gkJj Op5jHtvoqsuSyRVNPiNSE5/UtL5/7TYcnJ5c2mjYYijHfDfynZOaj2XkOcs5jTbNfNkc nErw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ekt2r633krBIKdm2MRWn1/pbuY6S29TraTxsvnoK4k=; b=U8T63wyLHXExnveWX6/nRLaSE7UorAGie6Dlyr+Own0GUjUTAXoq33GI24rZ6d1lWI Lb44F9x/XqWXrBJQHFPRGIxPqdjupOQy196ygZ0tqWXGG8k5RLNbtsYL3w6cRrZ9y8jU bF+vwx2/bTNichi9qOsKv0ymrLZMe4qFrhW0+w+v5DtGijeZsG4QJi7+hdFKaxlUWFHW d14UWh3EqTcXsqmehdKWMpeBRqkoZa2jAqCGbgr/1WcWW2sVnp1DFRI7HZ73GwrsKAiu 4aJYgVvaxxhlXR442AVz8n5PXNaQxyEhLAB2xEDfsuGiZcd3Cong0ygJ5SsGhirYRk1p xQHw== X-Gm-Message-State: APjAAAU3GNpBxa/p+y/Br8GG+J8mLqjxij4RgYhez6vXCihxaCi1sLVb FvxIIlJIEPQ/4JKozsGbPlVHqGfsj5k7LC33GApGZg== X-Google-Smtp-Source: APXvYqwQkbkxfA5DYAC5X7GLKci02tkbzr1oFaST60w1ilVREPi79ZyDCQMpkLqMnzKmdtR1QNgJ17evb3jAUFvvsKk= X-Received: by 2002:a1c:a651:: with SMTP id p78mr3454453wme.53.1571326138344; Thu, 17 Oct 2019 08:28:58 -0700 (PDT) MIME-Version: 1.0 References: <20191014121910.7264-1-ard.biesheuvel@linaro.org> <20191014121910.7264-8-ard.biesheuvel@linaro.org> In-Reply-To: From: Ard Biesheuvel Date: Thu, 17 Oct 2019 17:28:48 +0200 Message-ID: Subject: Re: [PATCH 07/25] crypto: s5p - switch to skcipher API To: Kamil Konieczny Cc: "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Herbert Xu , "David S. Miller" , Eric Biggers , linux-arm-kernel , Krzysztof Kozlowski , Vladimir Zapolskiy , Kamil Konieczny , linux-samsung-soc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, 17 Oct 2019 at 17:18, Kamil Konieczny wrote: > > Hi, > > On 14.10.2019 14:18, Ard Biesheuvel wrote: > > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > > dated 20 august 2015 introduced the new skcipher API which is supposed to > > replace both blkcipher and ablkcipher. While all consumers of the API have > > been converted long ago, some producers of the ablkcipher remain, forcing > > us to keep the ablkcipher support routines alive, along with the matching > > code to expose [a]blkciphers via the skcipher API. > > > > So switch this driver to the skcipher API, allowing us to finally drop the > > blkcipher code in the near future. > > > > Cc: Krzysztof Kozlowski > > Cc: Vladimir Zapolskiy > > Cc: Kamil Konieczny > > Cc: linux-samsung-soc@vger.kernel.org > > Signed-off-by: Ard Biesheuvel > > --- > > There are comments for hash functions changed, see below. > With that fixed, you can add my > > Reviewed-by: Kamil Konieczny > Tested-by: Kamil Konieczny > Thanks! > > drivers/crypto/s5p-sss.c | 191 ++++++++++---------- > > 1 file changed, 91 insertions(+), 100 deletions(-) > > [...] > > diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c > > index 010f1bb20dad..e6f1d4d5186c 100644 > > --- a/drivers/crypto/s5p-sss.c > > +++ b/drivers/crypto/s5p-sss.c > > [...] > > @@ -660,7 +660,7 @@ static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) > > { > > struct platform_device *pdev = dev_id; > > struct s5p_aes_dev *dev = platform_get_drvdata(pdev); > > - struct ablkcipher_request *req; > > + struct skcipher_request *req; > > int err_dma_tx = 0; > > int err_dma_rx = 0; > > int err_dma_hx = 0; > > These two comments below should not be touched, they are for hash part. > > > @@ -1208,7 +1208,7 @@ static int s5p_hash_prepare_sgs(struct s5p_hash_reqctx *ctx, > > * > > * Note 1: we can have update flag _and_ final flag at the same time. > > * Note 2: we enter here when digcnt > BUFLEN (=HASH_BLOCK_SIZE) or > > - * either req->nbytes or ctx->bufcnt + req->nbytes is > BUFLEN or > > + * either req->cryptlen or ctx->bufcnt + req->cryptlen is > BUFLEN or > > * we have final op > > */ > > static int s5p_hash_prepare_request(struct ahash_request *req, bool update) > > @@ -1555,7 +1555,7 @@ static int s5p_hash_final_shash(struct ahash_request *req) > > * s5p_hash_final() - close up hash and calculate digest > > * @req: AHASH request > > * > > - * Note: in final req->src do not have any data, and req->nbytes can be > > + * Note: in final req->src do not have any data, and req->cryptlen can be > > * non-zero. > > * > > * If there were no input data processed yet and the buffered hash data is > > [...] > > -- > Best regards, > Kamil Konieczny > Samsung R&D Institute Poland > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3041ECE58E for ; Thu, 17 Oct 2019 15:29:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A916320872 for ; Thu, 17 Oct 2019 15:29:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uXNZTDNt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rtG7U/WF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A916320872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PXmaqZ+62PgyP51O4Ox34pn+UpsnRUH/6Z4jQKwoXXc=; b=uXNZTDNtuR3B0f qtV/XOlgGn2FFrSGpDZ8BCdLk61bFw1iSGaQrvryuPgQ5RQC+RMovllJFq/LRAGGhrYyvBKJc3jfu ghYfq8amn4PIK3yHzREIpWXxcJNiCMRLqAz84U6+PFBjKNc3VOPsRxVLC5z28e0+zff6b8n3YrJn3 dK5I7B40GARZQMU2hhoRvjMEDE599XPlzvjRRyct124sy62610wsmaxR49rj56JpncIsLZpb8zQqZ 3rNi54aC88x1BnKyjhtpoLnAhaAXgPAJ/cWKGqMbYWLa14sUbBni4ft0hxcTWtLrG7xV3dnRp7JhJ laQz9mE1Qx0kgMESsrnA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iL7i7-0007kj-Az; Thu, 17 Oct 2019 15:29:07 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iL7i3-0007jq-Ju for linux-arm-kernel@lists.infradead.org; Thu, 17 Oct 2019 15:29:05 +0000 Received: by mail-wm1-x342.google.com with SMTP id a6so3003474wma.5 for ; Thu, 17 Oct 2019 08:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8ekt2r633krBIKdm2MRWn1/pbuY6S29TraTxsvnoK4k=; b=rtG7U/WFEJB937Z+UVa7zX93QaONAQY6vMOSjaE/oYZkhh4E4IlI7dU+lRGEsJwSyA mymkOhBUkVE6YLDzZhDWJIWv/XRTly2XbhE+BioypJNcpOJW7FBP2z/j7nHOhQecV+fu fL2/XPHmaAkSk3IaJA+V050VgvfGv2HtmATwlaUVKV6+ePESSqHNCk62XsACKWvn+edL HkANTtvyN4Wfo62Boe8Nclhv5FwClad+EPHthVIPdHYQKxQMh4TQjTITGGS0ARd5gkJj Op5jHtvoqsuSyRVNPiNSE5/UtL5/7TYcnJ5c2mjYYijHfDfynZOaj2XkOcs5jTbNfNkc nErw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8ekt2r633krBIKdm2MRWn1/pbuY6S29TraTxsvnoK4k=; b=nLKPV/WSO7QPshwK3G86BPdhKMGI9M3HmIz/XDTf3Zt3ygWh/lfVmP4ravy5EiflIQ 4l0cIetN7qPqYaEG53FuxneodMm/v2CHziyHJreum1mZ6shcVNZdgvYYMhtHssSBgAbo bT9/hwqCi1qTKoQQ4DydEYYrLrIm6Fwa0gPPDq1EfagKVMyCkqM1sAy6sxGzBcp78aZV PowtzFuFBsmsO3LvkpZgvHCgOjhooJRix5imtjkB+XhbkvnI3pX02vVuknKvf1bzx2Y7 x7y80E5HuRrAudkx14PQ7ALQMACx/4bYy7VjPXkd+1R2MwIdeXNSYe/itfV77W7V8WYH Veew== X-Gm-Message-State: APjAAAU1rvuRouwJX4WDIoumoKuCc1+UL/fpYguifq2uqaUxOWuBij3l 55PB2/lqi9ah/e+zMcRnsb3nJXUuBwz/VYYxyHBVPg== X-Google-Smtp-Source: APXvYqwQkbkxfA5DYAC5X7GLKci02tkbzr1oFaST60w1ilVREPi79ZyDCQMpkLqMnzKmdtR1QNgJ17evb3jAUFvvsKk= X-Received: by 2002:a1c:a651:: with SMTP id p78mr3454453wme.53.1571326138344; Thu, 17 Oct 2019 08:28:58 -0700 (PDT) MIME-Version: 1.0 References: <20191014121910.7264-1-ard.biesheuvel@linaro.org> <20191014121910.7264-8-ard.biesheuvel@linaro.org> In-Reply-To: From: Ard Biesheuvel Date: Thu, 17 Oct 2019 17:28:48 +0200 Message-ID: Subject: Re: [PATCH 07/25] crypto: s5p - switch to skcipher API To: Kamil Konieczny X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191017_082903_654318_C3834D28 X-CRM114-Status: GOOD ( 22.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, Herbert Xu , Eric Biggers , Krzysztof Kozlowski , Vladimir Zapolskiy , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Kamil Konieczny , "David S. Miller" , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 17 Oct 2019 at 17:18, Kamil Konieczny wrote: > > Hi, > > On 14.10.2019 14:18, Ard Biesheuvel wrote: > > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > > dated 20 august 2015 introduced the new skcipher API which is supposed to > > replace both blkcipher and ablkcipher. While all consumers of the API have > > been converted long ago, some producers of the ablkcipher remain, forcing > > us to keep the ablkcipher support routines alive, along with the matching > > code to expose [a]blkciphers via the skcipher API. > > > > So switch this driver to the skcipher API, allowing us to finally drop the > > blkcipher code in the near future. > > > > Cc: Krzysztof Kozlowski > > Cc: Vladimir Zapolskiy > > Cc: Kamil Konieczny > > Cc: linux-samsung-soc@vger.kernel.org > > Signed-off-by: Ard Biesheuvel > > --- > > There are comments for hash functions changed, see below. > With that fixed, you can add my > > Reviewed-by: Kamil Konieczny > Tested-by: Kamil Konieczny > Thanks! > > drivers/crypto/s5p-sss.c | 191 ++++++++++---------- > > 1 file changed, 91 insertions(+), 100 deletions(-) > > [...] > > diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c > > index 010f1bb20dad..e6f1d4d5186c 100644 > > --- a/drivers/crypto/s5p-sss.c > > +++ b/drivers/crypto/s5p-sss.c > > [...] > > @@ -660,7 +660,7 @@ static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) > > { > > struct platform_device *pdev = dev_id; > > struct s5p_aes_dev *dev = platform_get_drvdata(pdev); > > - struct ablkcipher_request *req; > > + struct skcipher_request *req; > > int err_dma_tx = 0; > > int err_dma_rx = 0; > > int err_dma_hx = 0; > > These two comments below should not be touched, they are for hash part. > > > @@ -1208,7 +1208,7 @@ static int s5p_hash_prepare_sgs(struct s5p_hash_reqctx *ctx, > > * > > * Note 1: we can have update flag _and_ final flag at the same time. > > * Note 2: we enter here when digcnt > BUFLEN (=HASH_BLOCK_SIZE) or > > - * either req->nbytes or ctx->bufcnt + req->nbytes is > BUFLEN or > > + * either req->cryptlen or ctx->bufcnt + req->cryptlen is > BUFLEN or > > * we have final op > > */ > > static int s5p_hash_prepare_request(struct ahash_request *req, bool update) > > @@ -1555,7 +1555,7 @@ static int s5p_hash_final_shash(struct ahash_request *req) > > * s5p_hash_final() - close up hash and calculate digest > > * @req: AHASH request > > * > > - * Note: in final req->src do not have any data, and req->nbytes can be > > + * Note: in final req->src do not have any data, and req->cryptlen can be > > * non-zero. > > * > > * If there were no input data processed yet and the buffered hash data is > > [...] > > -- > Best regards, > Kamil Konieczny > Samsung R&D Institute Poland > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel