[PATCH] PCI: Make pci_find_upstream_pcie_bridge() handle non PCIE VFs well

2013-01-08 Thread tadeusz . struk
pci_find_upstream_pcie_bridge() doesn't handle well non PCIE VFs that are part of a PCIE PF device. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- drivers/pci/search.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/pci/search.c b/drivers/pci

Re: [PATCH] PCI: Make pci_find_upstream_pcie_bridge() handle non PCIE VFs well

2013-01-09 Thread Tadeusz Struk
On 01/08/2013 05:05 PM, Don Dutile wrote: (a) no such thing as a non-PCIe VF -- all VFs are PCIe-based. The sriov spec says that a VF doesn't necessarily has to have PCIE cap: 3.5 PCI Express Capability: ... PFs and VFs are required to implement this capability ... subject to the

[PATCH] crypto: Fix DMA-API warning

2014-05-19 Thread Tadeusz Struk
With DMA-API debug enabled testmgr triggers a DMA-API: device driver maps memory from stack warning, when tested on a crypto HW accelerator. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/testmgr.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[RFC][PATCH 3/4] crypto: QAT dh895xcc accelerator support

2014-06-03 Thread Tadeusz Struk
Third patch adds dh895xcc hardware specific code. It hooks to the common infrastructure and provides acceleration for crypto algorithms. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com Acked-by: John Griffin john.grif...@intel.com Reviewed-by: Bruce W. Allan bruce.w.al...@intel.com

[RFC][PATCH 4/4] crypto: Updated makefiles to add QAT

2014-06-03 Thread Tadeusz Struk
Update to makefiles etc. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 6 ++ drivers/crypto/Kconfig | 1 + drivers/crypto/Makefile | 1 + firmware/Makefile

[RFC][PATCH 0/4] crypto: Intel QAT driver

2014-06-03 Thread Tadeusz Struk
on the hardware accelerator and the Quick Assist can be on: https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com Signed-off-by: Karen Xiang karen.xi...@intel.com Signed-off-by: Pingchaox Yang pingchaox.y...@intel.com

Re: [RFC][PATCH 4/4] crypto: Updated makefiles to add QAT

2014-06-03 Thread Tadeusz Struk
On 06/03/2014 12:16 PM, Randy Dunlap wrote: +source drivers/crypto/qat/Kconfig Missing that file ^^^ Hi, Something went wrong. I need to resend v2. Thanks Randy -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

[PATCH RFC 1/2] crypto: Simple crypto algorithm load balancer

2014-01-17 Thread Tadeusz Struk
allocated 3 times. That's ~0% Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/api.c | 25 ++--- include/linux/crypto.h |3 ++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crypto/api.c b/crypto/api.c index a2b39c5..0c0f1c3 100644

[PATCH RFC 2/2] crypto: Simple load balancer test module

2014-01-17 Thread Tadeusz Struk
Test module for the simple algorithm load balancer Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig|6 ++ crypto/Makefile |1 + crypto/test_alg_loadbalance.c | 231 + 3 files changed, 247

Re: [PATCH v4 6/7] sched: add function nr_running_cpu to expose number of tasks running on cpu

2014-07-12 Thread Tadeusz Struk
On 07/11/2014 01:33 PM, Tim Chen wrote: +unsigned long nr_running_cpu(int cpu) +{ + if (cpumask_test_cpu(cpu, cpu_online_mask)) + return cpu_rq(cpu)-nr_running; + else + return 0; +} + EXPORT_SYMBOL? -- To unsubscribe from this list: send the line

[PATCH] firmware: Automatically pull missing FW files

2014-08-20 Thread Tadeusz Struk
Hi, When a binary FW file is not present in the firmware dir then the build will fail. This patch enables auto-download any missing FW file for both shipped and external targets. Generated against linux-next. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- firmware/Makefile | 25

Re: [PATCH] firmware: Automatically pull missing FW files

2014-08-20 Thread Tadeusz Struk
Hi David, On 08/20/2014 11:34 AM, David Woodhouse wrote: I'm not sure I understand. Precisely what fails? I clone a subsystem, configure it to use CONFIG_EXTRA_FIRMWARE=qat_895xcc.bin, type make make install and get: MK_FW firmware/qat_895xxc.bin.gen.S make[1]: *** No rule to make target

Re: [PATCH] firmware: Automatically pull missing FW files

2014-08-20 Thread Tadeusz Struk
On 08/20/2014 01:39 PM, David Woodhouse wrote: On Wed, 2014-08-20 at 12:21 -0700, Tadeusz Struk wrote: Hi David, On 08/20/2014 11:34 AM, David Woodhouse wrote: I'm not sure I understand. Precisely what fails? I clone a subsystem, configure it to use CONFIG_EXTRA_FIRMWARE=qat_895xcc.bin

Re: [PATCH] crypto, qat, use generic numa functions

2014-10-08 Thread Tadeusz Struk
Hi Prarit, On 10/07/2014 05:12 PM, Prarit Bhargava wrote: The method in which the qat code determines the numa node for memory allocations is a bit clunky. On 2 socket, single node systems it is possible that adf_get_dev_node_id() returns node 1, even though node 1 doesn't exist. This code

Re: [PATCH v2 01/11] crypto: Documentation - crypto API high level spec

2014-11-05 Thread Tadeusz Struk
Hi, On 11/02/2014 12:35 PM, Stephan Mueller wrote: + * type: + - blkcipher for symmetric block ciphers blkcipher for synchronous block ciphers + - ablkcipher for asymmetric block ciphers ablkcipher for asynchronous block ciphers + - cipher for single

Re: [PATCH 0/3] crypto: algif - change algif_skcipher to be asynchronous

2015-02-02 Thread Tadeusz Struk
On 02/01/2015 10:31 AM, Stephan Mueller wrote: Hi Tadeusz, The way the algif_skcipher works currently is that on sendmsg/sendpage it builds an sgl for the input data and then on read/recvmsg it sends the job for encryption putting the user to sleep till the data is processed. This way

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-19 Thread Tadeusz Struk
a caller erroneously uses __driver-gcm-aes-aesni a call to crypto_aead_setkey will cause a NULL pointer dereference without this patch. Acked-by: Tadeusz Struk tadeusz.st...@intel.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: Intel GCM: __driver-gcm-aes-aesni setkey missing

2015-01-17 Thread Tadeusz Struk
Hi Stephan, On 01/17/2015 10:23 AM, Stephan Mueller wrote: during testing of my algif_aead patch with the different GCM implementations I am able to trigger a kernel crash from user space using __driver-gcm-aes- aesni. As I hope that algif_aead is going to be included, unprivileged

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-22 Thread Tadeusz Struk
On 01/22/2015 01:20 PM, Stephan Mueller wrote: That would be correct. But if I understood Herbert correctly, he is creating a patch that disables these service ciphers for general usage. Yes, and this should also implicitly fix the problem with user space. Thanks, Tadeusz -- To unsubscribe

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-22 Thread Tadeusz Struk
On 01/22/2015 02:23 PM, Herbert Xu wrote: Yes but we should also fix this so that it's a proper aead algorithm. Ok, I'll do that. Thanks, Tadeusz -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH] crypto: aesni: add setkey for driver-gcm-aes-aesni

2015-01-22 Thread Tadeusz Struk
On 01/20/2015 05:25 PM, Stephan Mueller wrote: Rather than adding a bogus setkey function, please fix this mess properly by moving the top-level setkey function into the __driver one where it should be. Compare with how we handle it in the ablk_helper which is pretty much the same thing.

Re: [PATCH 1/3] net: socket: enable async read and write

2015-01-30 Thread Tadeusz Struk
On 01/29/2015 03:13 PM, Tadeusz Struk wrote: AIO read or write are not currently supported on sockets. This patch enables real socket async read/write. Please note - this patch is generated against cryptodev. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- include/net/sock.h

Re: linux-next: build warnings after merge of the crypto tree

2015-03-10 Thread Tadeusz Struk
On 03/09/2015 11:03 PM, Herbert Xu wrote: This is a bit of a bummer. What happened is that net-next has killed the kiocb argument to sendmsg/recvmsg. However, this change is obviously not part of the crypto tree and algif_aead only exists in the crypto tree. So Stephen could you fix this

Re: [PATCH v12 1/2] crypto: AF_ALG: add AEAD support

2015-02-27 Thread Tadeusz Struk
On 02/27/2015 02:26 AM, Stephan Mueller wrote: This patch adds the AEAD support for AF_ALG. The implementation is based on algif_skcipher, but contains heavy modifications to streamline the interface for AEAD uses. To use AEAD, the user space consumer has to use the salg_type

[PATCH 2/3] crypto: af_alg - Allow to link sgl

2015-01-29 Thread Tadeusz Struk
Allow to link af_alg sgls. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/af_alg.c | 16 include/crypto/if_alg.h |4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/crypto/af_alg.c b/crypto/af_alg.c index 76d739d..99608f2

[PATCH 0/3] crypto: algif - change algif_skcipher to be asynchronous

2015-01-29 Thread Tadeusz Struk
the potential of existing crypto hardware accelerators it is required to submit multiple jobs in asynchronously. First patch enables asynchronous read and write on socket. Second patch enables af_alg sgl to be linked. Third patch implement asynch read for skcipher. Signed-off-by: Tadeusz Struk

[PATCH 1/3] net: socket: enable async read and write

2015-01-29 Thread Tadeusz Struk
AIO read or write are not currently supported on sockets. This patch enables real socket async read/write. Please note - this patch is generated against cryptodev. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- include/net/sock.h |2 ++ net/socket.c | 48

[PATCH 3/3] crypto: algif - change algif_skcipher to be asynchronous

2015-01-29 Thread Tadeusz Struk
it to be asynchronous by adding AIO support. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/algif_skcipher.c | 315 ++- 1 file changed, 309 insertions(+), 6 deletions(-) diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c index

Re: [PATCH RFC 1/2] crypto: add PKE API

2015-05-04 Thread Tadeusz Struk
On 05/02/2015 05:07 PM, Herbert Xu wrote: #define CRYPTO_ALG_TYPE_AHASH0x000a +#define CRYPTO_ALG_TYPE_PKE 0x000b #define CRYPTO_ALG_TYPE_RNG 0x000c Will filling a hole cause a problem with something that got obsoleted? I

Re: [PATCH RFC 1/2] crypto: add PKE API

2015-05-01 Thread Tadeusz Struk
Hi Stephan, On 05/01/2015 12:24 AM, Stephan Mueller wrote: +struct public_key; +struct public_key_signature; Wouldn't it make sense to move the struct definitions here and have them documented? I'm not sure if they belong here. I think we can add some documentation without moving them.

Re: [PATCH RFC 0/2] crypto: Introduce Public Key Encryption API

2015-05-01 Thread Tadeusz Struk
On 05/01/2015 01:47 AM, Jean Delvare wrote: I have nothing to do with this, please drop me from Cc. Sorry, your name was reported by scripts/get_maintainer.pl -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More

[PATCH RFC 1/2] crypto: add PKE API

2015-04-30 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/crypto_user.c | 23 + crypto/pke.c | 114 ++ include/crypto/algapi.h

[PATCH RFC 2/2] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-04-30 Thread Tadeusz Struk
Change the existing rsa and public key code to integrate it with the new Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- Documentation/crypto/asymmetric-keys.txt | 10 +++- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys

[PATCH RFC 0/2] crypto: Introduce Public Key Encryption API

2015-04-30 Thread Tadeusz Struk
to extend in the future when new algorithms will be added. --- Tadeusz Struk (2): crypto: add PKE API crypto: RSA: KEYS: convert rsa and public key to new PKE API Documentation/crypto/asymmetric-keys.txt | 10 +- crypto/Kconfig|6 + crypto/Makefile

Re: [PATCH RFC 1/2] crypto: add PKE API

2015-04-30 Thread Tadeusz Struk
On 04/30/2015 03:43 PM, Herbert Xu wrote: Please remodel it after pcompress or the newly converted rng type. This union stuff has been obsolete since 2008 and it's time for it to die. Ok, I didn't realize. Will send v2 shortly. Thanks -- To unsubscribe from this list: send the line

Re: [PATCH RFC 2/2] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-05-01 Thread Tadeusz Struk
On 05/01/2015 09:21 AM, David Howells wrote: +.verify = RSA_verify_signature, + .capabilities = PKEY_CAN_VERIFY, Can we keep .verify_signature as the name of the first. The second is redundant given the function pointers. I'm thinking that .verify will

Re: [PATCH RFC 1/2] crypto: add PKE API

2015-05-01 Thread Tadeusz Struk
On 05/01/2015 09:04 AM, David Howells wrote: +config CRYPTO_PKE I would prefer CRYPTO_PKEY and pkey rather than pke generally and algo rather than alg where possible - this will have more consistency with what we have now. I understand, however, that in core crypto code, 'alg' is used. I'm

[PATCH RFC v2 0/2] crypto: Introduce Public Key Encryption API

2015-05-06 Thread Tadeusz Struk
to the kernel - added documentation --- Tadeusz Struk (2): crypto: add PKEY API crypto: RSA: KEYS: convert rsa and public key to new PKEY API crypto/Kconfig|6 crypto/Makefile |1 crypto/asymmetric_keys/Kconfig

[PATCH RFC v2 1/2] crypto: add PKE API

2015-05-06 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/crypto_user.c | 24 +++ crypto/pkey.c | 125 ++ include/crypto/pkey.h | 390

[PATCH RFC v2 2/2] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-05-06 Thread Tadeusz Struk
Change the existing rsa and public key code to integrate it with the new Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys/pkcs7_parser.c |2 - crypto/asymmetric_keys/pkcs7_trust.c

Re: [PATCH RFC 0/2] crypto: Introduce Public Key Encryption API

2015-05-04 Thread Tadeusz Struk
Hi Horia, On 05/04/2015 06:16 AM, Horia Geantă wrote: int (*sign)(struct pke_request *pkereq); int (*verify)(struct pke_request *pkereq); int (*encrypt)(struct pke_request *pkereq); int (*decrypt)(struct pke_request *pkereq); Where would be the proper place for keygen

[PATCH RFC v3 2/3] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-06-03 Thread Tadeusz Struk
Change the existing rsa and public key code to integrate it with the new Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys/Makefile |1 crypto/asymmetric_keys/pkcs7_parser.c

[PATCH RFC v3 0/3] crypto: Introduce Public Key Encryption API

2015-06-03 Thread Tadeusz Struk
names from pke_* to pkey_* - retained the enum pkey_algo type for it is external to the kernel - added documentation --- Tadeusz Struk (3): crypto: add PKE API crypto: RSA: KEYS: convert rsa and public key to new PKE API crypto: add tests vectors for RSA crypto/Kconfig

[PATCH RFC v3 1/3] crypto: add PKE API

2015-06-03 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/akcipher.c | 100 +++ crypto/crypto_user.c | 23 +++ include/crypto/akcipher.h | 385

[PATCH RFC v3 3/3] crypto: add tests vectors for RSA

2015-06-03 Thread Tadeusz Struk
New test vectors for RSA algorithm. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/testmgr.c | 151 ++ crypto/testmgr.h | 86 +++ 2 files changed, 237 insertions(+) diff --git a/crypto/testmgr.c

Re: [PATCH RFC v3 1/3] crypto: add PKE API

2015-06-04 Thread Tadeusz Struk
Hi Herbert, On 06/03/2015 11:49 PM, Herbert Xu wrote: Because the caller is going to be allocating memory for the output, we need to provide a way for them to know how much memory to allocate. This presumably will depend on the key size. So something like int (*maxsize)(struct

Re: [PATCH RFC v3 2/3] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-06-04 Thread Tadeusz Struk
On 06/03/2015 11:53 PM, Herbert Xu wrote: I'd like to see this split into multiple patches. First of all the new crypto_akcipher implementation should coexist with the existing code. That way the exiting users can be converted over one-by-one. Also you should implement the crypto_akcipher

Re: [PATCH RFC v3 2/3] crypto: RSA: KEYS: convert rsa and public key to new PKE API

2015-06-05 Thread Tadeusz Struk
On 06/05/2015 01:50 AM, Paul Bolle wrote: This builds two modules if PUBLIC_KEY_ALGO_RSA = 'm': rsa.ko and rsa_pkcs1_v1_5.ko. Is that what you want? No, this not what I wanted. public_key.c uses this, so it can end up in public_key.ko. But it's not exported. So a _quick and dirty_ build

Re: [PATCH RFC v3 3/3] crypto: add tests vectors for RSA

2015-06-04 Thread Tadeusz Struk
Hi Stephan On 06/03/2015 05:15 PM, Stephan Mueller wrote: May I ask that the outbuf_enc is memcmp()ed with an expected value? This check is required for FIPS 140-2 compliance. Without that memcmp, FIPS 140-2 validations will not be successful. Sure, I will do that. I wasn't aware that this

Re: crypto: rsa - select on undefined AKCIPHER

2015-06-18 Thread Tadeusz Struk
for reporting this. --- 8 --- This patch fixes invalid config selection for AKCIPHER Reported-by: Andreas Ruprecht andreas.rupre...@fau.de Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- diff --git a/crypto/Kconfig b/crypto/Kconfig index 6c79ef0..b4cfc57 100644 --- a/crypto/Kconfig +++ b

Re: [PATCH v13 1/2] crypto: AF_ALG: add AEAD support

2015-06-11 Thread Tadeusz Struk
Hi Stephan, On 02/28/2015 11:50 AM, Stephan Mueller wrote: + err = af_alg_wait_for_completion(ctx-enc ? + crypto_aead_encrypt(ctx-aead_req) : + crypto_aead_decrypt(ctx-aead_req), +

[PATCH RFC v7 3/3] crypto: add tests vectors for RSA

2015-06-16 Thread Tadeusz Struk
New test vectors for RSA algorithm. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |1 crypto/testmgr.c | 158 ++ crypto/testmgr.h | 187 ++ 3 files changed, 346

[PATCH RFC v7 0/3] crypto: Introduce Public Key Encryption API

2015-06-16 Thread Tadeusz Struk
and sign operation - added RSA test vectors Changes in v2: - remodeled not to use obsolete cra_u and crt_u unions - changed type/funct names from pke_* to pkey_* - retained the enum pkey_algo type for it is external to the kernel - added documentation --- Tadeusz Struk (3): crypto: add

[PATCH RFC v7 2/3] crypto: rsa: add a new rsa generic implementation

2015-06-16 Thread Tadeusz Struk
Add a new rsa generic SW implementation. This implements only cryptographic primitives. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 315

[PATCH RFC v7 1/3] crypto: add PKE API

2015-06-16 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig | 11 + crypto/Makefile|1 crypto/akcipher.c | 117 crypto/crypto_user.c | 22 ++ include/crypto

Re: [PATCH RFC v4 2/4] crypto: add PKE API

2015-06-12 Thread Tadeusz Struk
On 06/11/2015 07:59 PM, Herbert Xu wrote: +int crypto_akcipher_setkey(struct crypto_akcipher *tfm, + const struct public_key *pkey) +{ + if (tfm-pkey) + akcipher_free_key(tfm-pkey); + + return akcipher_clone_key(tfm, pkey); +} No please do not expose

Re: [PATCH RFC v4 1/4] MPILIB: add mpi_read_buf(), mpi_copy() and mpi_get_size() helpers

2015-06-12 Thread Tadeusz Struk
On 06/12/2015 09:21 AM, Stephan Mueller wrote: +void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) +{ + uint8_t *buf, *p; + int n, ret; + + if (!nbytes) + return NULL; + + n = mpi_get_size(a); Shouldn't n be unsigned int? You are right,

Re: [PATCH RFC v7 2/3] crypto: rsa: add a new rsa generic implementation

2015-06-16 Thread Tadeusz Struk
Hi David, On 06/16/2015 03:10 PM, David Howells wrote: +static int _rsa_sign(const struct rsa_key *key, MPI s, MPI m) +{ + /* (1) Validate 0 = m n */ + if (mpi_cmp_ui(m, 0) 0 || mpi_cmp(m, key-n) = 0) + return -EINVAL; Why -EINVAL not -EBADMSG? I thought that -EBADMSG was

Re: [PATCH RFC v7 2/3] crypto: rsa: add a new rsa generic implementation

2015-06-16 Thread Tadeusz Struk
On 06/16/2015 07:36 PM, Herbert Xu wrote: The existing crypto/asymmetric_key errno scheme doesn't really mesh in with the rest of crypto. So you'll just have to pick one scheme and stick with it. I don't really mind either way as long as the error codes are unique and meaningful. So I

Re: [PATCH RFC v7 0/3] crypto: Introduce Public Key Encryption API

2015-06-17 Thread Tadeusz Struk
On 06/17/2015 02:14 AM, Herbert Xu wrote: This patch set introduces a Public Key Encryption API. What is proposed is a new crypto type called crypto_akcipher_type, plus new struct akcipher_alg and struct crypto_akcipher, together with number of helper functions to register akcipher type

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 05:05 PM, Herbert Xu wrote: + * @setkey: Function invokes the algorithm specific set key function, which + *knows how to decode and interpret the BER encoded key We should split this into two functions: setpubkey and setprivkey. The two functions will

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 07:50 PM, Herbert Xu wrote: If you want to keep the helper generic what you can do is have it take struct rsa_key instead of struct crypto_ablkcipher. Ok I'll do it that way. It definitely should just be an optional helper as opposed to a required part of crypto_akcipher

Re: [PATCH RFC v5 4/4] crypto: add tests vectors for RSA

2015-06-16 Thread Tadeusz Struk
On 06/15/2015 05:37 PM, Herbert Xu wrote: config CRYPTO_MANAGER tristate Cryptographic algorithm manager select CRYPTO_MANAGER2 + select CRYPTO_AKCIPHER Please add this to CRYPTO_MANAGER2 instead. This causes a recursive dependency error crypto/Kconfig:115:error: recursive

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 08:25 PM, Herbert Xu wrote: The current parse_key function requires all three number to be present, n, e, and d, no? No, it will handle whatever it will find. So if a public key will be passed it will only set n and e. If a private key will be passed it will set all three n, e,

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 09:06 PM, Herbert Xu wrote: No, it will handle whatever it will find. So if a public key will be passed it will only set n and e. If a private key will be passed it will set all three n, e, and d. Then during operation I check if there is everything that's required. AFAICS

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 04:59 PM, Herbert Xu wrote: +struct crypto_akcipher { + void *key; Having a void * pointer here is useless. The normal way of doing it is to place the key into the tfm context. I thought that the ctx needs to be available for implementations to store private data. This way

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 05:05 PM, Herbert Xu wrote: Hmm, we could actually get rid of maxsize by just having each function check the dst_len and if it is insufficient write the required length in it and then return an error. Actually I think it is useful. Without it the user will need to allocate a

Re: [PATCH RFC v5 3/4] crypto: rsa: add a new rsa generic implementation

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 07:19 PM, Stephan Mueller wrote: I'm not familiar with the FIPS requirements. I checked the NIST recommendations witch states that RSA: |n| = 2048 is acceptable. If FIPS allows 2K and 3K only then we need to change it. The reason for exclusive 2k/3k is the CAVS testing: there

[PATCH RFC v5 3/4] crypto: rsa: add a new rsa generic implementation

2015-06-15 Thread Tadeusz Struk
Add a new rsa generic SW implementation. This implements only cryptographic primitives. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 295

[PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/akcipher.c | 102 +++ crypto/crypto_user.c | 23 +++ include/crypto/akcipher.h | 404

[PATCH RFC v5 4/4] crypto: add tests vectors for RSA

2015-06-15 Thread Tadeusz Struk
New test vectors for RSA algorithm. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |1 crypto/testmgr.c | 149 ++ crypto/testmgr.h | 143 3 files changed

[PATCH RFC v5 1/4] MPILIB: add mpi_read_buf() and mpi_get_size() helpers

2015-06-15 Thread Tadeusz Struk
Added a mpi_read_buf() helper function to export MPI to a buf provided by the user, and a mpi_get_size() helper, that tells the user how big the buf is. Changed mpi_free to use kzfree instead of kfree because it is used to free crypto keys. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com

[PATCH RFC v5 0/4] crypto: Introduce Public Key Encryption API

2015-06-15 Thread Tadeusz Struk
names from pke_* to pkey_* - retained the enum pkey_algo type for it is external to the kernel - added documentation --- Tadeusz Struk (4): MPILIB: add mpi_read_buf(), mpi_copy() and mpi_get_size() helpers crypto: add PKE API crypto: rsa: add a new rsa generic implementation

[PATCH RFC v6 2/3] crypto: rsa: add a new rsa generic implementation

2015-06-16 Thread Tadeusz Struk
Add a new rsa generic SW implementation. This implements only cryptographic primitives. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 313

[PATCH RFC v6 0/3] crypto: Introduce Public Key Encryption API

2015-06-16 Thread Tadeusz Struk
type/funct names from pke_* to pkey_* - retained the enum pkey_algo type for it is external to the kernel - added documentation --- Tadeusz Struk (3): crypto: add PKE API crypto: rsa: add a new rsa generic implementation crypto: add tests vectors for RSA crypto/Kconfig

[PATCH RFC v6 1/3] crypto: add PKE API

2015-06-16 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig | 11 + crypto/Makefile|1 crypto/akcipher.c | 100 +++ crypto/crypto_user.c | 22 ++ include/crypto

[PATCH RFC v6 3/3] crypto: add tests vectors for RSA

2015-06-16 Thread Tadeusz Struk
New test vectors for RSA algorithm. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |1 crypto/testmgr.c | 161 ++ crypto/testmgr.h | 187 ++ 3 files changed, 349

Re: [PATCH RFC v5 3/4] crypto: rsa: add a new rsa generic implementation

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 04:23 PM, Stephan Mueller wrote: +/* In FIPS mode only allow key size minimum 2K */ + if (fips_enabled (mpi_get_size(key-n) 256)) { Considering my previous email, shouldn't that check rather be if (fips_enabled ((mpi_get_size(key-n) != 256) || (mpi_get_size(key-n)

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 07:27 PM, Herbert Xu wrote: The two functions will be almost identical. We can do it this way if we want to check if all the required elements of the key are provided. Currently I'm checking this in the actual operation. Right now your RSA setkey function only works if you

Re: [PATCH RFC v5 2/4] crypto: add PKE API

2015-06-15 Thread Tadeusz Struk
On 06/15/2015 07:29 PM, Herbert Xu wrote: I thought that the ctx needs to be available for implementations to store private data. This way we can allocate and store any type of key in the alg_parse_key() helper and still have the cxt available for implementations to use for their stuff

Re: [PATCH RFC v4 2/4] crypto: add PKE API

2015-06-12 Thread Tadeusz Struk
On 06/11/2015 07:42 PM, Herbert Xu wrote: The testmgr code can mark an entire cipher implementation as fips_allowed=1 as already done for RSA. However, unlike with the other ciphers, that flag must go in conjunction with the used key sizes. For FIPS mode, the following

Re: [PATCH RFC v2 1/2] crypto: add PKE API

2015-06-01 Thread Tadeusz Struk
On 05/31/2015 10:48 PM, Herbert Xu wrote: On Thu, May 28, 2015 at 09:54:41AM -0700, Tadeusz Struk wrote: If we do this that way then we will be able to pass only one input and one output parameter. There are cases when we will need more that this. For instance for ECDSA signature generation

Re: [PATCH RFC v2 1/2] crypto: add PKE API

2015-05-28 Thread Tadeusz Struk
On 05/27/2015 09:08 PM, Herbert Xu wrote: Do you have a specific piece of hardware in mind? What are its capabilities? I'm going to use it with Intel's DH985xcc accelerator. It can accelerate RSA, DH, ECDSA and ECDH just to name the most commonly used. But I don't want to add anything that is

[PATCH RFC v4 2/4] crypto: add PKE API

2015-06-11 Thread Tadeusz Struk
Add Public Key Encryption API. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/akcipher.c | 154 + crypto/crypto_user.c | 23 ++ include/crypto/akcipher.h | 408

[PATCH RFC v4 1/4] MPILIB: add mpi_read_buf(), mpi_copy() and mpi_get_size() helpers

2015-06-11 Thread Tadeusz Struk
Added a mpi_read_buf() helper function to export MPI to a buf provided by the user, and a mpi_get_size() helper, that tells the user how big the buf is. Implemented mpi_copy(), which was declared in mpi.h, but never implemented. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- include

[PATCH RFC v4 3/4] crypto: rsa: add a new rsa generic implementation

2015-06-11 Thread Tadeusz Struk
Add a new rsa generic SW implementation. This implements only cryptographic primitives. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |7 + crypto/Makefile |1 crypto/rsa.c| 289 +++ 3 files changed, 297

[PATCH RFC v4 0/4] crypto: Introduce Public Key Encryption API

2015-06-11 Thread Tadeusz Struk
: - remodeled not to use obsolete cra_u and crt_u unions - changed type/funct names from pke_* to pkey_* - retained the enum pkey_algo type for it is external to the kernel - added documentation --- Tadeusz Struk (4): MPILIB: add mpi_get_buf(), mpi_copy() and mpi_get_size() helpers

[PATCH RFC v4 4/4] crypto: add tests vectors for RSA

2015-06-11 Thread Tadeusz Struk
New test vectors for RSA algorithm. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/Kconfig |1 crypto/testmgr.c | 164 ++ crypto/testmgr.h | 142 +++ 3 files changed, 307

Re: [PATCH RFC v2 1/2] crypto: add PKE API

2015-05-23 Thread Tadeusz Struk
On 05/22/2015 10:47 PM, Herbert Xu wrote: struct akcipher_request { struct crypto_async_request base; struct scatterlist *inparams; struct scatterlist *outparams; void *__ctx[] CRYPTO_MINALIGN_ATTR; }; I think you should rename them to src/dst and add a length argument.

Re: [PATCH RFC v2 1/2] crypto: add PKE API

2015-05-22 Thread Tadeusz Struk
On 05/10/2015 11:32 PM, Herbert Xu wrote: On Wed, May 06, 2015 at 12:36:48PM -0700, Tadeusz Struk wrote: +const struct public_key_signature *signature; Doing this means that you aren't adding it to the crypto API properly. You need to start from scratch and design a proper interface

Re: linux-next: Tree for Aug 12 (include/linux/pci.h)

2015-08-12 Thread Tadeusz Struk
Hi, On 08/12/2015 02:53 PM, Stephen Rothwell wrote: On Wed, 12 Aug 2015 11:05:36 -0700 Randy Dunlap rdun...@infradead.org wrote: on i386 or x86_64: Many (repeated) errors like this one: ../include/linux/pci.h:390:12: error: ‘struct pci_dev’ has no member named ‘physfn’

[PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-12 Thread Tadeusz Struk
Don't need to move data inside of the output buffer because SW doen't need to do this anymore sice the new MPI mpi_read_buf() has been added. Just set the correct output len. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- drivers/crypto/qat/qat_common/qat_asym_algs.c |3 --- 1 file

[PATCH 0/2] crypto: KEYS: convert public key to the akcipher API

2015-08-12 Thread Tadeusz Struk
. There is no need for MPI above the API anymore. Modules can be verified with software as well as HW rsa implementations. Also changed qat rsa implementation not to move data inside the output buff similarly to SW. --- Tadeusz Struk (2): crypto: KEYS: convert public key to the akcipher API

[PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-12 Thread Tadeusz Struk
. There is no need for MPI above the API anymore. Modules can be verified with software as well as HW rsa implementations. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- crypto/asymmetric_keys/Kconfig|2 crypto/asymmetric_keys/Makefile |7 - crypto/asymmetric_keys

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-17 Thread Tadeusz Struk
and attach it to the patch. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-24 Thread Tadeusz Struk
Hi Stephan, On 08/15/2015 11:08 AM, Stephan Mueller wrote: Am Mittwoch, 12. August 2015, 20:54:39 schrieb Tadeusz Struk: Hi Tadeusz, @@ -41,7 +41,7 @@ struct pkcs7_parse_context { static void pkcs7_free_signed_info(struct pkcs7_signed_info *sinfo) { if (sinfo

Re: [PATCH 1/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread Tadeusz Struk
On 08/13/2015 07:23 AM, David Howells wrote: Tadeusz Struk tadeusz.st...@intel.com wrote: const char *const pkey_algo_name[PKEY_ALGO__LAST] = { -[PKEY_ALGO_DSA] = DSA, -[PKEY_ALGO_RSA] = RSA, +[PKEY_ALGO_DSA] = dsa, +[PKEY_ALGO_RSA] = rsa

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-13 Thread Tadeusz Struk
On 08/12/2015 08:54 PM, Tadeusz Struk wrote: Don't need to move data inside of the output buffer because SW doen't need to do this anymore sice the new MPI mpi_read_buf() has been added. Just set the correct output len. Signed-off-by: Tadeusz Struk tadeusz.st...@intel.com --- drivers

Re: [PATCH 0/2] crypto: KEYS: convert public key to the akcipher API

2015-08-13 Thread Tadeusz Struk
On 08/13/2015 06:56 AM, David Howells wrote: Can you rebase this on top of: http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs.git/log/?h=modsign-pkcs7 David Will do. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

Re: [PATCH 2/2] crypto: qat - Don't move data inside output buffer

2015-08-14 Thread Tadeusz Struk
On 08/13/2015 10:14 PM, Herbert Xu wrote: diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c index fe352a6..6ddb13c 100644 --- a/drivers/crypto/qat/qat_common/qat_asym_algs.c +++ b/drivers/crypto/qat/qat_common/qat_asym_algs.c @@

  1   2   3   4   5   6   7   >