Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp631663ybl; Wed, 29 Jan 2020 06:58:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzgrTCRyk1cvxnIlk9XyD4pBmrRXYrB1LsHwa0hfm/Wl/CG/X3W9JZDiT8j+yeepcLytQUM X-Received: by 2002:a05:6830:13d3:: with SMTP id e19mr20932774otq.135.1580309904548; Wed, 29 Jan 2020 06:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580309904; cv=none; d=google.com; s=arc-20160816; b=hPoPyVBO6pBiORqwCoHnG30TZrgEv0XqzR3nwA43Jb+HSphwJelEiVLYg39fjq2Dkp g1udaxFuhdCsFSCRLxD4sAZlMYe0mAF+v62StXpnuIGQIe4UqSF0F0c38H2tVwDrZJP7 kWT1SetfYtnoFl6PYZ9+kPDVPWol2jNOPuv6FWSIe1FkDtrtbnlZVIqqjDqVmbKfDFS2 XTW+z5zNTnxZ9JDgGGxBVNAB97hfbst3tGJHQZojR2cntNlVTZdv2noTixhxGL1bf4ae LSCJFW8v0lYxOEGiDdBy5XJkwrWuU5hxhIOt2xHSIv3h1kamqXG4tb1ZRSgdAt5hKzbL zG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=98/1pZSuwZiSFwLJuAyYfT+2dHa717H2MdqRYmDk+Pc=; b=iojLKUOCn57KT9ZBn96H7Heo+4F813g8O5WOOCs4a4H51xUzt/nPmMIw2eT2EF85d4 t0edSASsmB4sRtNa5G6/4akChPGx84OT53I5W6jDUElemM+DU8qa5uHt+0vGng7Bnp6k kXXr3y5QEUuu5Eo5p2/TPfoI6ckHtd/w+bdQyv3Dwq6wzWpVqsjxjjJYBUdCmEGia1wk nCsQnIo8v6xLECkoU5imM9srT+Tj5P8Y9b8PcXVjMpfuKGAwtikAln3Jyk8KlfAQ0X+5 1nNOol3lP+LU0qIMWFAoWerB8R5CE7aww3FDiG2mTwFUAOcrnqixC7IyE8NmE86T3VJW GPbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y17si1216230otk.81.2020.01.29.06.58.09; Wed, 29 Jan 2020 06:58:24 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726620AbgA2O6H (ORCPT + 99 others); Wed, 29 Jan 2020 09:58:07 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35883 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726605AbgA2O6H (ORCPT ); Wed, 29 Jan 2020 09:58:07 -0500 Received: by mail-ot1-f68.google.com with SMTP id g15so15817075otp.3; Wed, 29 Jan 2020 06:58:06 -0800 (PST) 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=98/1pZSuwZiSFwLJuAyYfT+2dHa717H2MdqRYmDk+Pc=; b=NCnTYnwURfwnLce1Clv3d3riEC1JmRyqakTyGcC2yzoEZCOz2TKsIfWCruLv5FWXkF Nu8F2uHy1D6kKy9CGltiwqYfIu/JGytCDWTPe1D0zWFY94gRX+DWZKfd0B8ADlGRlMTV o3Qs0pl0hho1B/Jkj5JWQloKEoLyeMs5worUOyesyO2n3P86evGfzDkl5N4uwkF4cVdQ jnoYxutbDI2umTipKO/7y6lQ+OTcArj/U964vfOAIlQeACl9nygU0F/tAGE2gwn3Yz3R gXInVrdbZiP4v+gKHVRkDa0tsCS2TZ5dILKNXahMqvCEwQjQMZnt8fHS3twmE4mLRS1W oSpQ== X-Gm-Message-State: APjAAAX8CRXZ0SX4p4T401biO5Z3LonT8UDkjdH3s/OWuAlnJfgSVYq2 teyyTPibvB/B49YJmOUcnsCahUIIYiH8mq363bM= X-Received: by 2002:a9d:dc1:: with SMTP id 59mr21064913ots.250.1580309886519; Wed, 29 Jan 2020 06:58:06 -0800 (PST) MIME-Version: 1.0 References: <20200129143757.680-1-gilad@benyossef.com> <20200129143757.680-4-gilad@benyossef.com> In-Reply-To: <20200129143757.680-4-gilad@benyossef.com> From: Geert Uytterhoeven Date: Wed, 29 Jan 2020 15:57:55 +0100 Message-ID: Subject: Re: [PATCH 3/4] crypto: ccree - fix some reported cipher block sizes To: Gilad Ben-Yossef Cc: Herbert Xu , "David S. Miller" , Ofir Drang , Linux Crypto Mailing List , Linux Kernel Mailing List 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 Hi Gilad, On Wed, Jan 29, 2020 at 3:38 PM Gilad Ben-Yossef wrote: > OFB and CTR modes block sizes were wrongfully reported as > the underlying block sizes. Fix it to 1 bytes as they > turn the block ciphers into stream ciphers. > > Also document why our XTS differes from the generic > implementation. > > Signed-off-by: Gilad Ben-Yossef > --- > drivers/crypto/ccree/cc_cipher.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/crypto/ccree/cc_cipher.c b/drivers/crypto/ccree/cc_cipher.c > index c08dee04941b..73457548ee92 100644 > --- a/drivers/crypto/ccree/cc_cipher.c > +++ b/drivers/crypto/ccree/cc_cipher.c > @@ -1236,6 +1236,10 @@ static const struct cc_alg_template skcipher_algs[] = { > .sec_func = true, > }, > { > + /* See https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg40576.html You may want to refer to https://lore.kernel.org/linux-crypto/20190910012134.GA24413@gondor.apana.org.au/ instead, as mail-archive is maintained externally. > + * for the reason why this differs from the generic > + * implementation. > + */ > .name = "xts(aes)", > .driver_name = "xts-aes-ccree", > .blocksize = 1, > @@ -1431,7 +1435,7 @@ static const struct cc_alg_template skcipher_algs[] = { > { > .name = "ofb(aes)", > .driver_name = "ofb-aes-ccree", > - .blocksize = AES_BLOCK_SIZE, > + .blocksize = 1, > .template_skcipher = { > .setkey = cc_cipher_setkey, > .encrypt = cc_cipher_encrypt, > @@ -1584,7 +1588,7 @@ static const struct cc_alg_template skcipher_algs[] = { > { > .name = "ctr(sm4)", > .driver_name = "ctr-sm4-ccree", > - .blocksize = SM4_BLOCK_SIZE, > + .blocksize = 1, > .template_skcipher = { > .setkey = cc_cipher_setkey, > .encrypt = cc_cipher_encrypt, > -- > 2.25.0 > -- Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds