Re: [PATCH v4 0/6] crypto: lib/sha256 - cleanup/optimization

2020-10-29 Thread Herbert Xu
On Sun, Oct 25, 2020 at 10:31:13AM -0400, Arvind Sankar wrote: > Patch 1/2 -- Use memzero_explicit() instead of structure assignment/plain > memset() to clear sensitive state. > > Patch 3 -- Currently the temporary variables used in the generic sha256 > implementation are cleared, but the clearing

Re: [PATCH 0/2] crypto: hisilicon - misc fixes

2020-10-29 Thread Herbert Xu
On Thu, Oct 15, 2020 at 10:23:02AM +0800, Longfang Liu wrote: > This patchset fixes some coding style. > > Longfang Liu (2): > crypto: hisilicon - delete unused structure member variables > crypto: hisilicon - fixes some coding style > > drivers/crypto/hisilicon/sec2/sec.h| 2 -- >

Re: [PATCH] crypto: x86 - remove unused file aes_glue.c

2020-10-29 Thread Herbert Xu
Eric Biggers wrote: > From: Eric Biggers > > Commit 1d2c3279311e ("crypto: x86/aes - drop scalar assembler > implementations") was meant to remove aes_glue.c, but it actually left > it as an unused one-line file. Remove this unused file. > > Cc: Ard Biesheuvel > Signed-off-by: Eric Biggers >

Re: [PATCH] crypto: sm2 - remove unnecessary reset operations

2020-10-29 Thread Herbert Xu
On Thu, Oct 15, 2020 at 05:24:41PM +0800, Tianjia Zhang wrote: > This is an algorithm optimization. The reset operation when > setting the public key is repeated and redundant, so remove it. > At the same time, `sm2_ecc_os2ec()` is optimized to make the > function more simpler and more in line with

Re: [PATCH -next] crypto: omap-aes - fix the reference count leak of omap device

2020-10-29 Thread Herbert Xu
On Fri, Oct 16, 2020 at 05:05:36PM +0800, Zhang Qilong wrote: > pm_runtime_get_sync() will increment pm usage counter even > when it returns an error code. We should call put operation > in error handling paths of omap_aes_hw_init. > > Signed-off-by: Zhang Qilong > --- > drivers/crypto/omap-aes

Re: [PATCH 1/1] crypto: hisilicon: Fix doc warnings in sgl.c and qm.c

2020-10-29 Thread Herbert Xu
On Fri, Oct 09, 2020 at 09:19:38AM +0100, Shiju Jose wrote: > Fix following warnings caused by mismatch between > function parameters and function comments. > > drivers/crypto/hisilicon/sgl.c:256: warning: Excess function parameter > 'hw_sgl_dma' description in 'hisi_acc_sg_buf_unmap' > drivers/c

Re: [PATCH 00/31] crypto: qat - rework in preparation for qat_4xxx driver

2020-10-29 Thread Herbert Xu
On Mon, Oct 12, 2020 at 09:38:16PM +0100, Giovanni Cabiddu wrote: > This set is an initial rework of the QAT driver in preparation for the > inclusion of the qat_4xxx driver (QAT GEN4). > > Summary of changes: > * IV update logic moved to software to remove allocation of the IV > buffer in t

Re: [PATCH] crypto: inside-secure: Fix sizeof() mismatch

2020-10-29 Thread Herbert Xu
On Sat, Oct 10, 2020 at 05:47:36PM +0100, Colin King wrote: > From: Colin Ian King > > An incorrect sizeof() is being used, sizeof(priv->ring[i].rdr_req) is > not correct, it should be sizeof(*priv->ring[i].rdr_req). Note that > since the size of ** is the same size as * this is not causing any >

Re: [PATCH] crypto: talitos - Fix return type of current_desc_hdr()

2020-10-29 Thread Herbert Xu
On Thu, Oct 08, 2020 at 09:34:56AM +, Christophe Leroy wrote: > current_desc_hdr() returns a u32 but in fact this is a __be32, > leading to a lot of sparse warnings. > > Change the return type to __be32 and ensure it is handled as > sure by the caller. > > Fixes: 3e721aeb3df3 ("crypto: talito

Re: [PATCH] crypto: talitos - Endianess in current_desc_hdr()

2020-10-29 Thread Herbert Xu
On Thu, Oct 08, 2020 at 09:34:55AM +, Christophe Leroy wrote: > current_desc_hdr() compares the value of the current descriptor > with the next_desc member of the talitos_desc struct. > > While the current descriptor is obtained from in_be32() which > return CPU ordered bytes, next_desc member

Re: [PATCH] crypto: qat - remove unused function

2020-10-29 Thread Herbert Xu
On Wed, Oct 07, 2020 at 01:43:45PM +0100, Giovanni Cabiddu wrote: > Remove unused function qat_dh_get_params(). > This is to fix the following warning when compiling the driver with > CC=clang W=1 > > drivers/crypto/qat/qat_common/qat_asym_algs.c:207:34: warning: unused > function 'qat_dh_get

[PATCH] treewide: Remove stringification from __alias macro definition

2020-10-29 Thread Joe Perches
Like the old __section macro, the __alias macro uses macro # stringification to create quotes around the symbol name used in the __attribute__. This can cause differences between gcc and clang when the stringification itself contains a quote character. So avoid these differences by always using q

Re: [PATCH] crypto: x86/aesni - implement accelerated CBCMAC, CMAC and XCBC shashes

2020-10-29 Thread Ard Biesheuvel
On Wed, 23 Sep 2020 at 13:03, Ben Greear wrote: > > On 8/4/20 12:45 PM, Ben Greear wrote: > > On 8/4/20 6:08 AM, Ard Biesheuvel wrote: > >> On Tue, 4 Aug 2020 at 15:01, Ben Greear wrote: > >>> > >>> On 8/4/20 5:55 AM, Ard Biesheuvel wrote: > On Mon, 3 Aug 2020 at 21:11, Ben Greear wrote: >

Re: [RESEND PATCH] KEYS: asymmetric: Fix kerneldoc

2020-10-29 Thread Ben Boeckel
On Thu, Oct 29, 2020 at 16:48:30 +0100, Krzysztof Kozlowski wrote: > Fix W=1 compile warnings (invalid kerneldoc): > > crypto/asymmetric_keys/asymmetric_type.c:160: warning: Function parameter > or member 'kid1' not described in 'asymmetric_key_id_same' > crypto/asymmetric_keys/asymmetric

[RESEND PATCH] KEYS: asymmetric: Fix kerneldoc

2020-10-29 Thread Krzysztof Kozlowski
Fix W=1 compile warnings (invalid kerneldoc): crypto/asymmetric_keys/asymmetric_type.c:160: warning: Function parameter or member 'kid1' not described in 'asymmetric_key_id_same' crypto/asymmetric_keys/asymmetric_type.c:160: warning: Function parameter or member 'kid2' not described in '

Re: [PATCH] crypto: arm64/poly1305-neon - reorder PAC authentication with SP update

2020-10-29 Thread Andy Polyakov
> (+ Andy) Thanks! Applied to cryptogams, pinged openssl. Cheers.

[PATCH v3 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-29 Thread Gilad Ben-Yossef
Replace the explicit EBOIV handling in the dm-crypt driver with calls into the crypto API, which now possesses the capability to perform this processing within the crypto subsystem. Signed-off-by: Gilad Ben-Yossef --- drivers/md/dm-crypt.c | 61 ++- 1 fil

[PATCH v3 4/4] crypto: ccree: re-introduce ccree eboiv support

2020-10-29 Thread Gilad Ben-Yossef
BitLocker eboiv support, which was removed in commit 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") is reintroduced based on the crypto API new support for eboiv. Signed-off-by: Gilad Ben-Yossef Fixes: 1d8b41ff6991 ("crypto: ccree - remove bitlocker cipher") --- drivers/crypto/ccree/cc

[PATCH v3 2/4] crypto: add eboiv(cbc(aes)) test vectors

2020-10-29 Thread Gilad Ben-Yossef
Add test vectors for the use of the EBOIV template with cbc(aes) modes as it is being used by dm-crypt for BitLocker support. Vectors taken from dm-crypt test suite images. Signed-off-by: Gilad Ben-Yossef --- crypto/tcrypt.c | 9 ++ crypto/testmgr.c | 6 + crypto/testmgr.h | 279 ++

[PATCH v3 0/4] crypto: switch to crypto API for EBOIV generation

2020-10-29 Thread Gilad Ben-Yossef
This series creates an EBOIV template that produces a skcipher transform which passes through all operations to the skcipher, while using the same skcipher and key to encrypt the input IV, which is assumed to be a sector offset, although this is not enforced. This matches dm-crypt use of EBOIV t

[PATCH v3 1/4] crypto: add eboiv as a crypto API template

2020-10-29 Thread Gilad Ben-Yossef
Encrypted byte-offset initialization vector (EBOIV) is an IV generation method that is used in some cases by dm-crypt for supporting the BitLocker volume encryption used by Windows 8 and onwards as a backwards compatible version in lieu of XTS support. Support for eboiv was added to dm-crypt in 5.6

Re: [PATCH] crypto: arm/aes-neonbs - fix usage of cbc(aes) fallback

2020-10-29 Thread Herbert Xu
On Wed, Oct 28, 2020 at 10:06:58AM +0100, Ard Biesheuvel wrote: > > Not sure what is happening here: IIRC the intention was to rely on the > fact that only the sync cbc(aes) implementation needs the fallback, > and therefore, allocating a sync skcipher explicitly would avoid this > recursion. > >

Re: [PATCH 3/4] dm crypt: switch to EBOIV crypto API template

2020-10-29 Thread Herbert Xu
On Wed, Oct 28, 2020 at 01:41:28PM +0200, Gilad Ben-Yossef wrote: > > Sorry if I'm being daft, but what did you refer to be "an existing > option"? there was no CONFIG_EBOIV before my patchset, it was simply > built as part of dm-crypt so it seems that setting CONFIG_EBOIV > default to dm-crypto Kc

Re: [PATCH v2 1/6] crypto: Use memzero_explicit() for clearing state

2020-10-29 Thread Herbert Xu
On Fri, Oct 23, 2020 at 02:53:29PM -0700, Eric Biggers wrote: > > It's doubtful that anyone will do a global conversion from memset() to > memzero_explicit(), as it's too hard to find all the places that should be > converted. They are in lots of different subsystems; the crypto subsystem > will