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_

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 >> > +++

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

2015-08-14 Thread Tadeusz Struk
Hi Herbert, On 08/13/2015 11:26 PM, Herbert Xu wrote: > On Thu, Aug 13, 2015 at 11:14:11PM -0700, Tadeusz Struk wrote: >> >> Right, but we don't need that anymore. > > Why not? If you reduce the size without moving the buffer wouldn't > it begin with a bunch of zero

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

2015-08-14 Thread Tadeusz Struk
On 08/13/2015 11:26 PM, Herbert Xu wrote: > On Thu, Aug 13, 2015 at 11:14:11PM -0700, Tadeusz Struk wrote: >> >> Right, but we don't need that anymore. > > Why not? If you reduce the size without moving the buffer wouldn't > it begin with a bunch of zeroes and wouldn't

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

2015-08-17 Thread Tadeusz Struk
k may be able to pick it up and attach it to the patch. Signed-off-by: Tadeusz Struk -- 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.ht

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

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 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 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 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 --- drivers/crypto/qat/qat_common/qat_asym_algs.c |3 --- 1 file changed, 3 deletions

[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 --- crypto/asymmetric_keys/Kconfig|2 crypto/asymmetric_keys/Makefile |7 - crypto/asymmetric_keys/pkcs7_parser.c

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 > --- >

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

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 wrote: > >> const char *const pkey_algo_name[PKEY_ALGO__LAST] = { >> -[PKEY_ALGO_DSA] = "DSA", >> -[PKEY_ALGO_RSA] = "RSA", >> +[PKEY_ALGO_DSA]

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

2015-01-19 Thread Tadeusz Struk
tkey > function. In case 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a me

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/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

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

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.

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

[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 --- 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 --- include/linux/mpi.h |3

[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 --- crypto/Kconfig |7 + crypto/Makefile |1 crypto/rsa.c| 289 +++ 3 files changed, 297 insertions(+) create

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

2015-06-11 Thread Tadeusz Struk
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 (4): MPILIB: add mpi_get_buf(), mpi_copy() and mpi_get_

[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 --- crypto/Kconfig |1 crypto/testmgr.c | 164 ++ crypto/testmgr.h | 142 +++ 3 files changed, 307 insertions(+) diff --git

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(>aead_req) : > + crypto_aead_decrypt(>aead_req), > +

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); >> > +}

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

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

[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 --- include/linux/mpi.h

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

2015-06-15 Thread Tadeusz Struk
ged 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_read_buf(), mpi_copy() and mpi_get_size() helpers crypto: add PKE API crypto: rsa: add a new rsa generic

[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 --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 295 + crypto

[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 --- 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 --- crypto/Kconfig |1 crypto/testmgr.c | 149 ++ crypto/testmgr.h | 143 3 files changed, 293 insertions(+) diff

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) ||

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

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.

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

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 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

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 >> > _parse_key() helper and still have the cxt >> > available for implementations to use for

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 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

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

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:

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

2015-06-16 Thread Tadeusz Struk
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 PKE API crypto: rsa: add a new rsa generic implementation crypto: add tests vectors for RSA

[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 --- crypto/Kconfig | 11 + crypto/Makefile|1 crypto/akcipher.c | 100 +++ crypto/crypto_user.c | 22 ++ include/crypto/akcipher.h | 323

[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 --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 313 + 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 --- crypto/Kconfig |1 crypto/testmgr.c | 161 ++ crypto/testmgr.h | 187 ++ 3 files changed, 349 insertions(+) diff --git

[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 --- crypto/Kconfig |1 crypto/testmgr.c | 158 ++ crypto/testmgr.h | 187 ++ 3 files changed, 346 insertions(+) diff --git

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

2015-06-16 Thread Tadeusz Struk
RSA encrypt, decrypt 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 St

[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 --- crypto/Kconfig|7 + crypto/Makefile |8 + crypto/rsa.c | 315 + crypto

[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 --- crypto/Kconfig | 11 + crypto/Makefile|1 crypto/akcipher.c | 117 crypto/crypto_user.c | 22 ++ include/crypto/akcipher.h

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

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

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

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

2015-06-03 Thread Tadeusz Struk
- 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 PKE API crypto: RSA: KEYS: convert rsa and public key to new PKE API crypto: add tests vectors for RSA

[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 --- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys/Makefile |1 crypto/asymmetric_keys/pkcs7_parser.c |2 crypto

[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 --- crypto/testmgr.c | 151 ++ crypto/testmgr.h | 86 +++ 2 files changed, 237 insertions(+) diff --git a/crypto/testmgr.c b/crypto/testmgr.c

[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 --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/akcipher.c | 100 +++ crypto/crypto_user.c | 23 +++ include/crypto/akcipher.h | 385

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 i

Re: crypto: rsa - select on undefined AKCIPHER

2015-06-18 Thread Tadeusz Struk
ect such > issues (scripts/checkkconfigsymbols.py). Hi Andreas, Yes it should have been CRYPTO_AKCIPHER. Thanks for reporting this. --- >8 --- This patch fixes invalid config selection for AKCIPHER Reported-by: Andreas Ruprecht Signed-off-by: Tadeusz Struk --- diff --git a/crypto/Kco

[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 --- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys/pkcs7_parser.c |2 - crypto/asymmetric_keys/pkcs7_trust.c |2 - crypto

[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 --- crypto/Kconfig |6 + crypto/Makefile|1 crypto/crypto_user.c | 24 +++ crypto/pkey.c | 125 ++ include/crypto/pkey.h | 390

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

2015-05-06 Thread Tadeusz Struk
s external 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_ke

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

2015-04-30 Thread Tadeusz Struk
t;aes". It will also make it easier 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

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

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

[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 --- Documentation/crypto/asymmetric-keys.txt | 10 +++- crypto/asymmetric_keys/Kconfig|1 crypto/asymmetric_keys/pkcs7_parser.c |4

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 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

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

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

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

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. > >

[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 --- 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 100644 --- a/crypto/af_alg.c

[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 --- 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 --- 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 38a6757..c953200 100644

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 > --- > include/net

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

Re: Problem with RSA test from testmgr

2017-03-01 Thread Tadeusz Struk
Hi Corentin, On 03/01/2017 04:04 AM, Corentin Labbe wrote: >> I would think the issue is that the OpenSSL BIGNUM lib has some issues: when >> calculating m^e mod n, m has to be equal to the key size. The kernel's MPI >> code handles the case where m is smaller than the key size. >> >> Note, in

Re: Problem with RSA test from testmgr

2017-03-02 Thread Tadeusz Struk
Hi Stephan, On 03/01/2017 10:08 PM, Stephan Müller wrote: >> memset(ptextp, 0, 256); >> memcpy(ptextp + 64 - 8, ptext_ex, plen); > I actually have tested that and it did not return the data the kernel > implementation would return It did for me: Result 64 plen=8 63 1c cd 7b e1 7e e4 de

Re: Problem with RSA test from testmgr

2017-03-02 Thread Tadeusz Struk
On 03/01/2017 10:21 PM, Corentin Labbe wrote: > I am finishing a patch that made testmgr test both (padded and unpadded). Even if you patch the test vectors there is no guarantee that a user of the API will always have the plain text padded. It can be anything between 1 and the key size. This

[PATCH RFC 1/2] driver core: allow EPROBE_DEFER after boot

2017-02-06 Thread Tadeusz Struk
the core to busy loop. Reviewed-by: Ira Weiny Signed-off-by: Tadeusz Struk --- drivers/base/dd.c | 26 +- drivers/base/driver.c |2 +- include/linux/device.h |2 ++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/base/dd.c b/drivers

[PATCH RFC 2/2] IB/hfi1: Fix port ordering issue in a multiport device

2017-02-06 Thread Tadeusz Struk
is IB device unit numbers are in reverse order from the faceplate numbering. This leads to confusion, and errors. Use EPROBE_DEFER error code to enforce correct port order. Reviewed-by: Ira Weiny Signed-off-by: Tadeusz Struk --- drivers/infiniband/hw/hfi1/chip.c | 95

Re: [PATCH] crypto: qat: remove unused vairable.

2016-05-11 Thread Tadeusz Struk
change the adf_ctl_stop_devices to void Change the adf_ctl_stop_devices to a void function. Signed-off-by: Tadeusz Struk --- drivers/crypto/qat/qat_common/adf_ctl_drv.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/qat/qat_common/adf_ctl_drv.c b/drivers/crypto/qat/qat_

Re: [RFC PATCH 5/8] KEYS: Provide software public key query function [ver 3]

2016-05-11 Thread Tadeusz Struk
On 05/11/2016 04:50 PM, Mat Martineau wrote: > >> +len = crypto_akcipher_maxsize(tfm); >> +info->key_size = len * 8; >> +info->max_data_size = len; >> +info->max_sig_size = len; >> +info->max_enc_size = len; >> +info->max_dec_size = len; > > If len > UINT16_MAX, should

[PATCH v6 1/6] crypto: AF_ALG -- add sign/verify API

2016-05-14 Thread Tadeusz Struk
From: Stephan Mueller Add the flags for handling signature generation and signature verification. Also, the patch adds the interface for setting a public key. Signed-off-by: Stephan Mueller Signed-off-by: Tadeusz Struk --- include/uapi/linux/if_alg.h |3 +++ 1 file changed, 3 insertions

[PATCH v6 0/6] crypto: algif - add akcipher

2016-05-14 Thread Tadeusz Struk
): crypto: AF_ALG -- add sign/verify API crypto: AF_ALG -- add setpubkey setsockopt call crypto: AF_ALG -- add asymmetric cipher interface crypto: algif_akcipher - enable compilation Tadeusz Struk (2): crypto: algif_akcipher - add ops_nokey crypto: AF_ALG - add

[PATCH v6 2/6] crypto: AF_ALG -- add setpubkey setsockopt call

2016-05-14 Thread Tadeusz Struk
From: Stephan Mueller For supporting asymmetric ciphers, user space must be able to set the public key. The patch adds a new setsockopt call for setting the public key. Signed-off-by: Stephan Mueller --- crypto/af_alg.c | 18 +- include/crypto/if_alg.h |1 + 2

[PATCH v6 6/6] crypto: AF_ALG - add support for key_id

2016-05-14 Thread Tadeusz Struk
akcipher api or invoke operations defined by a given subtype, depending on the key type. Signed-off-by: Tadeusz Struk --- crypto/af_alg.c | 10 ++ crypto/algif_akcipher.c | 207 ++- include/crypto/if_alg.h |1 include/uapi/linux

[PATCH v6 4/6] crypto: algif_akcipher - enable compilation

2016-05-14 Thread Tadeusz Struk
From: Stephan Mueller Add the Makefile and Kconfig updates to allow algif_akcipher to be compiled. Signed-off-by: Stephan Mueller Signed-off-by: Tadeusz Struk --- crypto/Kconfig |9 + crypto/Makefile |1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b

[PATCH v6 3/6] crypto: AF_ALG -- add asymmetric cipher interface

2016-05-14 Thread Tadeusz Struk
-off-by: Tadeusz Struk --- crypto/algif_akcipher.c | 542 +++ 1 file changed, 542 insertions(+) create mode 100644 crypto/algif_akcipher.c diff --git a/crypto/algif_akcipher.c b/crypto/algif_akcipher.c new file mode 100644 index 000..6342b6e --- /dev

[PATCH v6 5/6] crypto: algif_akcipher - add ops_nokey

2016-05-14 Thread Tadeusz Struk
Similar to algif_skcipher and algif_hash, algif_akcipher needs to prevent user space from using the interface in an improper way. This patch adds nokey ops handlers, which do just that. Signed-off-by: Tadeusz Struk --- crypto/algif_akcipher.c | 159

Re: v4.6-rc1 regression bisected, Problem loading in-kernel X.509 certificate (-2)

2016-05-03 Thread Tadeusz Struk
On 05/03/2016 07:26 PM, Jamie Heilman wrote: >>> Alrighty, presumably relevant bits: >>> > > >>> > > X.509: Cert Issuer: Build time autogenerated kernel key >>> > > X.509: Cert Subject: Build time autogenerated kernel key >>> > > X.509: Cert Key Algo: rsa >>> > > X.509: Cert Valid period:

Re: v4.6-rc1 regression bisected, Problem loading in-kernel X.509 certificate (-2)

2016-05-04 Thread Tadeusz Struk
pkcs1pad template needs CRYPTO_MANAGER so it needs to be explicitly selected by CRYPTO_RSA. Reported-by: Jamie Heilman Signed-off-by: Tadeusz Struk --- crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/Kconfig b/crypto/Kconfig index 93a1fdc..1d33beb 100644 --- a/crypto/Kcon

[PATCH RESEND v5 0/6] crypto: algif - add akcipher

2016-05-05 Thread Tadeusz Struk
-- add setpubkey setsockopt call crypto: AF_ALG -- add asymmetric cipher interface crypto: algif_akcipher - enable compilation Tadeusz Struk (2): crypto: algif_akcipher - add ops_nokey crypto: AF_ALG - add support for key_id crypto/Kconfig |9 crypto/Makefile

[PATCH RESEND v5 4/6] crypto: algif_akcipher - enable compilation

2016-05-05 Thread Tadeusz Struk
From: Stephan Mueller Add the Makefile and Kconfig updates to allow algif_akcipher to be compiled. Signed-off-by: Stephan Mueller Signed-off-by: Tadeusz Struk --- crypto/Kconfig |9 + crypto/Makefile |1 + 2 files changed, 10 insertions(+) diff --git a/crypto/Kconfig b

[PATCH RESEND v5 3/6] crypto: AF_ALG -- add asymmetric cipher interface

2016-05-05 Thread Tadeusz Struk
-off-by: Tadeusz Struk --- crypto/algif_akcipher.c | 542 +++ 1 file changed, 542 insertions(+) create mode 100644 crypto/algif_akcipher.c diff --git a/crypto/algif_akcipher.c b/crypto/algif_akcipher.c new file mode 100644 index 000..6342b6e --- /dev

[PATCH RESEND v5 2/6] crypto: AF_ALG -- add setpubkey setsockopt call

2016-05-05 Thread Tadeusz Struk
From: Stephan Mueller For supporting asymmetric ciphers, user space must be able to set the public key. The patch adds a new setsockopt call for setting the public key. Signed-off-by: Stephan Mueller --- crypto/af_alg.c | 18 +- include/crypto/if_alg.h |1 + 2

<    1   2   3   4   5   6   7   >