Re: [PATCH v3 4/4] crypto: add CRYPTO_TFM_REQ_IV_SERIALIZE flag

2018-02-13 Thread Harsh Jain
On 10-02-2018 03:34, Stephan Müller wrote: > Crypto drivers may implement a streamlined serialization support for AIO > requests that is reported by the CRYPTO_ALG_SERIALIZES_IV_ACCESS flag to > the crypto user. When the user decides that he wants to send multiple > AIO requests concurrently and

Re: [PATCH v3 1/4] crypto: AF_ALG AIO - lock context IV

2018-02-13 Thread Harsh Jain
On 10-02-2018 03:33, Stephan Müller wrote: > The kernel crypto API requires the caller to set an IV in the request data > structure. That request data structure shall define one particular cipher > operation. During the cipher operation, the IV is read by the cipher > implementation and eventuall

Re: [PATCH 14/14] x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather

2018-02-13 Thread Junaid Shahid
[Resending after delivery failure] Hi Dave, On 02/13/2018 10:22 AM, Dave Watson wrote: > > Yes, these both sound reasonable. I will send a V2. > > Thanks! Another minor suggestion for v2: It might be a good idea to check if the first assoclen bytes are already contiguous and only do the kmall

Re: [PATCH v2 3/5] crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS

2018-02-13 Thread Ard Biesheuvel
On 13 February 2018 at 18:57, Eric Biggers wrote: > Hi Ard, > > On Tue, Feb 13, 2018 at 11:34:36AM +, Ard Biesheuvel wrote: >> Hi Eric, >> >> On 12 February 2018 at 23:52, Eric Biggers wrote: >> > Add an ARM NEON-accelerated implementation of Speck-XTS. It operates on >> > 128-byte chunks at

Re: [PATCH v2 3/5] crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS

2018-02-13 Thread Eric Biggers
Hi Ard, On Tue, Feb 13, 2018 at 11:34:36AM +, Ard Biesheuvel wrote: > Hi Eric, > > On 12 February 2018 at 23:52, Eric Biggers wrote: > > Add an ARM NEON-accelerated implementation of Speck-XTS. It operates on > > 128-byte chunks at a time, i.e. 8 blocks for Speck128 or 16 blocks for > > Spe

Re: [PATCH 14/14] x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather

2018-02-13 Thread Dave Watson
On 02/13/18 08:42 AM, Stephan Mueller wrote: > > +static int gcmaes_encrypt_sg(struct aead_request *req, unsigned int > > assoclen, + u8 *hash_subkey, u8 *iv, void *aes_ctx) > > +{ > > + struct crypto_aead *tfm = crypto_aead_reqtfm(req); > > + unsigned long auth_tag_len = crypto

Re: [PATCH 14/14] x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather

2018-02-13 Thread Dave Watson
On 02/12/18 03:12 PM, Junaid Shahid wrote: > 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

RE: [Crypto v4 03/12] support for inline tls

2018-02-13 Thread Atul Gupta
-Original Message- From: David Miller [mailto:da...@davemloft.net] Sent: Tuesday, February 13, 2018 1:19 AM To: Atul Gupta Cc: davejwat...@fb.com; herb...@gondor.apana.org.au; s...@queasysnail.net; linux-crypto@vger.kernel.org; net...@vger.kernel.org; Ganesh GR Subject: Re: [Crypto v

Re: [PATCH v2 3/5] crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS

2018-02-13 Thread Ard Biesheuvel
Hi Eric, On 12 February 2018 at 23:52, Eric Biggers wrote: > Add an ARM NEON-accelerated implementation of Speck-XTS. It operates on > 128-byte chunks at a time, i.e. 8 blocks for Speck128 or 16 blocks for > Speck64. Each 128-byte chunk goes through XTS preprocessing, then is > encrypted/decryp

Re: [PATCH] crypto: arm/aes-cipher - move S-box to .rodata section

2018-02-13 Thread Ard Biesheuvel
On 12 February 2018 at 13:52, Jinbum Park wrote: > Move the AES inverse S-box to the .rodata section > where it is safe from abuse by speculation. > > Signed-off-by: Jinbum Park Acked-by: Ard Biesheuvel > --- > arch/arm/crypto/aes-cipher-core.S | 19 ++- > 1 file changed, 10 i

Re: [PATCH] crypto: Fix incorrect values in PKCS#1 test vector

2018-02-13 Thread Stephan Mueller
Am Dienstag, 13. Februar 2018, 09:29:56 CET schrieb Mcloughlin, Conor: Hi Conor, > The RSA private key for the first form should have > version, prime1, prime2, exponent1, exponent2, coefficient > values 0. > With non-zero values for prime1,2, exponent 1,2 and coefficient > the Intel QAT driver w

[PATCH 3/8] crypto: inside-secure - fix the extra cache computation

2018-02-13 Thread Antoine Tenart
This patch fixes the extra cache computation when the queued data is a multiple of a block size. This fixes the hash support in some cases. Fixes: 809778e02cd4 ("crypto: inside-secure - fix hash when length is a multiple of a block") Signed-off-by: Antoine Tenart --- drivers/crypto/inside-secur

[PATCH 7/8] crypto: inside-secure - keep the requests push/pop synced

2018-02-13 Thread Antoine Tenart
This patch updates the Inside Secure SafeXcel driver to avoid being out-of-sync between the number of requests sent and the one being completed. The number of requests acknowledged by the driver can be different than the threshold that was configured if new requests were being pushed to the h/w in

[PATCH] crypto: Fix incorrect values in PKCS#1 test vector

2018-02-13 Thread Mcloughlin, Conor
The RSA private key for the first form should have version, prime1, prime2, exponent1, exponent2, coefficient values 0. With non-zero values for prime1,2, exponent 1,2 and coefficient the Intel QAT driver will assume that values are provided for the private key second form. This will result in sign

[PATCH 6/8] crypto: inside-secure - fix the invalidation step during cra_exit

2018-02-13 Thread Antoine Tenart
When exiting a transformation, the cra_exit() helper is called in each driver providing one. The Inside Secure SafeXcel driver has one, which is responsible of freeing some areas and of sending one invalidation request to the crypto engine, to invalidate the context that was used during the transfo

[PATCH 0/8] crypto: inside-secure - stabilization and fixes

2018-02-13 Thread Antoine Tenart
Hi Herbert, We spent a lot of time with Ofer to test various use cases of the Inside Secure driver. We performed many tests in addition to the crypto subsystem ones (IPsec, openssl speed, tcrypt...). As a result the driver is a lot more stable in various configurations, with this series applied.

[PATCH 2/8] crypto: inside-secure - do not overwrite the threshold value

2018-02-13 Thread Antoine Tenart
This patch fixes the Inside Secure SafeXcel driver not to overwrite the interrupt threshold value. In certain cases the value of this register, which controls when to fire an interrupt, was overwritten. This lead to packet not being processed or acked as the driver never was aware of their completi

[PATCH 8/8] crypto: inside-secure - unmap the result in the hash send error path

2018-02-13 Thread Antoine Tenart
This patch adds a label to unmap the result buffer in the hash send function error path. Fixes: 1b44c5a60c13 ("crypto: inside-secure - add SafeXcel EIP197 crypto engine driver") Suggested-by: Ofer Heifetz Signed-off-by: Antoine Tenart --- drivers/crypto/inside-secure/safexcel_hash.c | 4 +++-

[PATCH 4/8] crypto: inside-secure - fix the cache_len computation

2018-02-13 Thread Antoine Tenart
This patch fixes the cache length computation as cache_len could end up being a negative value. The check between the queued size and the block size is updated to reflect the caching mechanism which can cache up to a full block size (included!). Fixes: 809778e02cd4 ("crypto: inside-secure - fix ha

[PATCH 1/8] MAINTAINERS: update the Inside Secure maintainer email

2018-02-13 Thread Antoine Tenart
Free Electrons became Bootlin. Update my email accordingly. Signed-off-by: Antoine Tenart --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 3bdc260e36b7..d0f6811b9eed 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -6990,7 +6990,7 @

[PATCH 5/8] crypto: inside-secure - do not process request if no command was issued

2018-02-13 Thread Antoine Tenart
This patch adds a check in the SafeXcel dequeue function, to avoid processing request further if no hardware command was issued. This can happen in certain cases where the ->send() function caches all the data that would have been send. Fixes: 809778e02cd4 ("crypto: inside-secure - fix hash when l