[PATCH 4/8] crypto: ecc - remove casts in crypto_ecdh_shared_secret

2017-05-12 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unnecessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 12 ++-- crypto/ecc.h | 4 ++-- crypto/ecdh.c | 6

[PATCH 0/8] cleanning and fixes for ecc, (ec)dh

2017-05-12 Thread Tudor Ambarus
function that generates ecc public keys. Tudor Ambarus (8): crypto: kpp, (ec)dh - fix typos crypto: ecc - remove unused function arguments crypto: ecc - remove casts in ecdh_make_pub_key crypto: ecc - remove casts in crypto_ecdh_shared_secret crypto: ecc - remove casts in ecc_is_key_valid

[PATCH 1/8] crypto: kpp, (ec)dh - fix typos

2017-05-12 Thread Tudor Ambarus
While here, add missing argument description (ndigits). Signed-off-by: Tudor Ambarus --- crypto/dh.c | 4 ++-- crypto/dh_helper.c| 4 ++-- crypto/ecc.h | 8 +--- crypto/ecdh.c | 4 ++-- crypto/ecdh_helper.c | 4 ++-- include/crypto/dh.h | 4 ++-- include

[PATCH 2/8] crypto: ecc - remove unused function arguments

2017-05-12 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 8 +++- crypto/ecc.h | 13 +++-- crypto/ecdh.c | 11 +-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 414c78a..69b4cc4 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c

[PATCH 3/8] crypto: ecc - remove casts in ecdh_make_pub_key

2017-05-12 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unnecessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 10 -- crypto/ecc.h | 2 +- crypto/ecdh.c | 3 +-- 3

Re: [PATCH 1/2] crypto: dh - fix dh_max_size

2017-05-12 Thread Tudor Ambarus
Please ignore this patch set. I will send all the changes in a new patch set. On 10.05.2017 16:04, Tudor Ambarus wrote: The function should return minimum size for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 2 +- 1 file chang

Re: [PATCH 0/4] clean some ecc functions

2017-05-12 Thread Tudor Ambarus
Please ignore this patch set. I will send all the changes in a new patch set. On 10.05.2017 11:40, Tudor Ambarus wrote: ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. Remove the unncessary casts. Tudor

[PATCH 1/2] crypto: dh - fix dh_max_size

2017-05-10 Thread Tudor Ambarus
The function should return minimum size for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/dh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/dh.c b/crypto/dh.c index 87e3542..53d17ff 100644 --- a/crypto/dh.c +++ b/c

[PATCH 2/2] crypto: ecdh - fix ecdh_max_size

2017-05-10 Thread Tudor Ambarus
The function should return minimum size for output buffer or error code if key hasn't been set. Signed-off-by: Tudor Ambarus --- crypto/ecdh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crypto/ecdh.c b/crypto/ecdh.c index 63ca337..01bfd13 100644 --- a/c

[PATCH 1/4] crypto: ecc - remove unused function arguments

2017-05-10 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 8 +++- crypto/ecc.h | 13 +++-- crypto/ecdh.c | 11 +-- 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 414c78a..69b4cc4 100644 --- a/crypto/ecc.c +++ b/crypto/ecc.c

[PATCH 2/4] crypto: ecc - remove casts in ecdh_make_pub_key

2017-05-10 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unncessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 10 -- crypto/ecc.h | 2 +- crypto/ecdh.c | 3 +-- 3

[PATCH 4/4] crypto: ecc - remove casts in ecc_is_key_valid

2017-05-10 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unncessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 6 +++--- crypto/ecc.h | 2 +- crypto/ecdh.c | 2 +- 3 files

[PATCH 3/4] crypto: ecc - remove casts in crypto_ecdh_shared_secret

2017-05-10 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. This patch removes the unncessary casts. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 12 ++-- crypto/ecc.h | 4 ++-- crypto/ecdh.c | 6

[PATCH 0/4] clean some ecc functions

2017-05-10 Thread Tudor Ambarus
ecc software implementation works with chunks of u64 data. There were some unnecessary casts to u8 and then back to u64 for the ecc keys. Remove the unncessary casts. Tudor Ambarus (4): crypto: ecc - remove unused function arguments crypto: ecc - remove casts in ecdh_make_pub_key crypto

ecdh: generation and retention of ecc privkey in kernel/hardware

2017-04-27 Thread Tudor Ambarus
Hi, Herbert, I'm working with a crypto accelerator that is capable of generating and retaining ecc private keys in hardware and further use them for ecdh. The private keys can not be read from the device. This is good because the less software has access to secrets, the better. Generation and re

Re: [RFC PATCH 0/8] crypto: AF_ALG support for KPP

2017-04-19 Thread Tudor Ambarus
Hi, Stephan, Herbert, On 19.04.2017 02:03, Stephan Müller wrote: The patch 8 describes the different operations that are supported by AF_ALG KPP. This support includes generation and retaining of the private key inside the kernel. This private key would never be sent to user space. There are c

[PATCH v2] crypto: caam - treat SGT address pointer as u64

2016-09-30 Thread Tudor Ambarus
!= caam endianness. Signed-off-by: Tudor Ambarus --- v2: Removed mx7d restriction. drivers/crypto/caam/desc.h | 6 -- drivers/crypto/caam/regs.h | 8 drivers/crypto/caam/sg_sw_sec4.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam

[PATCH] crypto: caam - treat SGT address pointer as u64

2016-09-29 Thread Tudor Ambarus
!= caam endianness. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/desc.h | 6 -- drivers/crypto/caam/regs.h | 8 drivers/crypto/caam/sg_sw_sec4.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/desc.h b/drivers/crypto/caam

[v10 PATCH] crypto: caam - add support for RSA algorithm

2016-07-04 Thread Tudor Ambarus
Add RSA support to caam driver. Initial author is Yashpal Dutta . Signed-off-by: Tudor Ambarus --- Changes in v10: - remove unused asn1 header files Changes in v9: - do not drop leading zeros for the RSA output. Changes in v8: - store raw keys on stack - use d_sz instead of n_sz for RSA

[v9 PATCH] crypto: caam - add support for RSA algorithm

2016-07-01 Thread Tudor Ambarus
Add RSA support to caam driver. Initial author is Yashpal Dutta . Signed-off-by: Tudor Ambarus --- Changes in v9: - do not drop leading zeros for the RSA output. Changes in v8: - store raw keys on stack - use d_sz instead of n_sz for RSA private exponent - add caam_read_raw_data function for

[PATCH] crypto: caam - replace deprecated EXTRA_CFLAGS

2016-06-16 Thread Tudor Ambarus
EXTRA_CFLAGS is still supported but its usage is deprecated. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/caam/Makefile b/drivers/crypto/caam/Makefile index 399ad55..3e9d3e1 100644 --- a/drivers

[PATCH v8 0/3] crypto: caam - add support for RSA algorithm

2016-06-15 Thread Tudor Ambarus
done callback - remove redundant clean code on error path - fix doc typos Changes in v5: - sync with ASN.1 parser Changes in v4: - sync with ASN.1 parser Changes in v3: - sync with ASN.1 parser Changes in v2: - fix memory leaks on error path - rename struct akcipher_alg rsa to caam_rsa Tudor

[PATCH v8 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-06-15 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v8 3/3] crypto: caam - add support for RSA algorithm

2016-06-15 Thread Tudor Ambarus
Add RSA support to caam driver. Initial author is Yashpal Dutta . Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 693 ++ drivers/crypto/caam/caampkc.h

[PATCH v8 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-06-15 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros for the output data of the RSA algorithm, after the computation completes. Signed-off-by: Tudor Ambarus

[PATCH v5] crypto: rsa - return raw integers for the ASN.1 parser

2016-06-14 Thread Tudor Ambarus
Return the raw key with no other processing so that the caller can copy it or MPI parse it, etc. The scope is to have only one ANS.1 parser for all RSA implementations. Update the RSA software implementation so that it does the MPI conversion on top. Signed-off-by: Tudor Ambarus --- Changes in

[PATCH v4] crypto: rsa - return raw integers for the ASN.1 parser

2016-06-13 Thread Tudor Ambarus
Return the raw key with no other processing so that the caller can copy it or MPI parse it, etc. The scope is to have only one ANS.1 parser for all RSA implementations. Update the RSA software implementation so that it does the MPI conversion on top. Signed-off-by: Tudor Ambarus --- Changes in

[PATCH v7 0/3] crypto: caam - add support for RSA algorithm

2016-06-07 Thread Tudor Ambarus
Tudor Ambarus (3): crypto: scatterwak - Add scatterwalk_sg_copychunks crypto: scatterwalk - export scatterwalk_pagedone crypto: caam - add support for RSA algorithm crypto/scatterwalk.c | 31 +- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4

[PATCH 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-06-07 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros for the output data of the RSA algorithm, after the computation completes. Signed-off-by: Tudor Ambarus

[PATCH 3/3] crypto: caam - add support for RSA algorithm

2016-06-07 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 637 ++ drivers/crypto/caam/caampkc.h

[PATCH 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-06-07 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v3] crypto: rsa - return raw integers for the ASN.1 parser

2016-06-07 Thread Tudor Ambarus
Return the raw key with no other processing so that the caller can copy it or MPI parse it, etc. The scope is to have only one ANS.1 parser for all RSA implementations. Update the RSA software implementation so that it does the MPI conversion on top. Signed-off-by: Tudor Ambarus --- crypto

[PATCH v6 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-05-19 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v6 0/3] crypto: caam - add support for RSA algorithm

2016-05-19 Thread Tudor Ambarus
clean code on error path - fix doc typos Changes in v5: - sync with ASN.1 parser Changes in v4: - sync with ASN.1 parser Changes in v3: - sync with ASN.1 parser Changes in v2: - fix memory leaks on error path - rename struct akcipher_alg rsa to caam_rsa Tudor Ambarus (3): crypto: scatterwak

[PATCH v6 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-05-19 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros for the output data of the RSA algorithm, after the computation completes. Signed-off-by: Tudor Ambarus

[PATCH v6 3/3] crypto: caam - add support for RSA algorithm

2016-05-19 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 567 ++ drivers/crypto/caam/caampkc.h

[PATCH v2] crypto: rsa - return raw integers for the ASN.1 parser

2016-05-12 Thread Tudor Ambarus
Return kmalloced raw integers with no other processing. The scope is to have only one ANS.1 parser for the RSA keys. Update the RSA software implementation so that it does the MPI conversion on top. Signed-off-by: Tudor Ambarus --- Changes from initial patch: - remove device related variables

[PATCH 3/3] crypto: caam - add support for RSA algorithm

2016-05-12 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig| 12 ++ drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 466 + drivers/crypto/caam/caampkc.h | 94

[PATCH 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-05-12 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros for the output data of the RSA algorithm, after the computation completes. Signed-off-by: Tudor Ambarus

[PATCH v5 0/3] crypto: caam - add support for RSA algorithm

2016-05-12 Thread Tudor Ambarus
rsa to caam_rsa Tudor Ambarus (3): crypto: scatterwak - Add scatterwalk_sg_copychunks crypto: scatterwalk - export scatterwalk_pagedone crypto: caam - add support for RSA algorithm crypto/scatterwalk.c | 31 ++- drivers/crypto/caam/Kconfig| 12 ++ drivers/crypto/caam

[PATCH 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-05-12 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH] lib: asn1_decoder - add MODULE_LICENSE("GPL")

2016-04-29 Thread Tudor Ambarus
tary module has been inserted, which is not the case here. Signed-off-by: Tudor Ambarus --- lib/asn1_decoder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c index 2b3f46c..b1ffcab 100644 --- a/lib/asn1_decoder.c +++ b/lib/asn1_decoder.c @@ -12,

[PATCH v4 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-04-29 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v4 3/3] crypto: caam - add support for RSA algorithm

2016-04-29 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig| 12 ++ drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 470 + drivers/crypto/caam/caampkc.h | 84

[PATCH v4 0/3] crypto: caam - add support for RSA algorithm

2016-04-29 Thread Tudor Ambarus
ver to use the new ASN.1 parser. Tudor Ambarus (3): crypto: scatterwak - Add scatterwalk_sg_copychunks crypto: scatterwalk - export scatterwalk_pagedone crypto: caam - add support for RSA algorithm crypto/scatterwalk.c | 31 ++- drivers/crypto/caam/Kconfig| 12 ++ drivers/c

[PATCH v4 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-04-29 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros for the output data of the RSA algorithm, after the computation completes. Signed-off-by: Tudor Ambarus

[PATCH] crypto: rsa - return raw integer for the ASN.1 parser

2016-04-29 Thread Tudor Ambarus
Return the raw integer with no other processing. The scope is to have only one ANS.1 parser for the RSA keys. Update the RSA software implementation so that it does the MPI conversion on top. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 122 ++- crypto

[PATCH v3 3/3] crypto: caam - add support for RSA algorithm

2016-04-06 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 509 + drivers/crypto/caam/caampkc.h | 84

[PATCH v3 0/3] crypto: caam - add support for RSA algorithm

2016-04-06 Thread Tudor Ambarus
it selects CRYPTO_RSA Tudor Ambarus (3): crypto: scatterwak - Add scatterwalk_sg_copychunks crypto: scatterwalk - export scatterwalk_pagedone crypto: caam - add support for RSA algorithm crypto/scatterwalk.c | 31 ++- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefi

[PATCH v3 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-04-06 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v3 3/3] crypto: rsa_helper - export symbols for asn1 structures

2016-04-06 Thread Tudor Ambarus
Export rsapubkey_decoder and rsaprivkey_decoder structures, since they can (will) be used by caam and qat drivers. Signed-off-by: Tudor Ambarus --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_helper.c index df1f480..d81a0ec 100644

[PATCH v3 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-04-06 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros of RSA's algorithm output. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c

[PATCH v3 1/3] crypto: rsa - generalize ASN.1 sequences

2016-04-06 Thread Tudor Ambarus
ction pointers to specific actions. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 60 ++- crypto/rsa_helper.c | 166 -- include/crypto/internal/rsa.h | 31 ++-- 3 files changed, 194 insertions(+), 63 deletions(-)

[PATCH v3 0/3] crypto: rsa - generalize ASN.1 sequences

2016-04-06 Thread Tudor Ambarus
v2 patch set can be found here: http://www.mail-archive.com/linux-crypto%40vger.kernel.org/msg18269.html Changes to v2 patch set: - "crypto: add CONFIG_ symbol for rsa helper" - removed. The drivers will select the CRYPTO_RSA symbol instead. Tudor Ambarus (3): c

[PATCH v3 2/3] crypto: rsa_helper - add raw integer parser actions

2016-04-06 Thread Tudor Ambarus
Dedicated to RSA (hardware) implementations that want to use raw integers instead of MPI keys. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 15 crypto/rsa_helper.c | 182 ++ include/crypto/internal/rsa.h | 28

[PATCH v2 2/2] crypto: qat - fix address leaking of RSA public exponent

2016-03-23 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c index 8dbbf084..05f49d4 100644 --- a/drivers/crypto

[PATCH v2 0/2] crypto: qat fixes

2016-03-23 Thread Tudor Ambarus
Initial patch set can be found here: http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg18185.html This patch set is no longer related to the generalized ASN.1 parser. Tadeusz will remove the ASN.1 parser from qat. No changes from initial patch set. Tudor Ambarus (2): crypto

[PATCH v2 1/2] crypto: qat - avoid memory corruption or undefined behaviour

2016-03-23 Thread Tudor Ambarus
memcopying to a (null pointer + offset) will result in memory corruption or undefined behaviour. Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b

[PATCH v2 3/3] crypto: caam - add support for RSA algorithm

2016-03-23 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 509 + drivers/crypto/caam/caampkc.h | 84

[PATCH v2 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-03-23 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros of RSA's algorithm output. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c

[PATCH v2 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-03-23 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v2 0/3] crypto: caam - add support for RSA algorithm

2016-03-23 Thread Tudor Ambarus
a_free_key helper function - fix memory leaks on error path - rename rsa akcipher_alg struct to caam_rsa Tudor Ambarus (3): crypto: scatterwak - Add scatterwalk_sg_copychunks crypto: scatterwalk - export scatterwalk_pagedone crypto: caam - add support for RSA algorith

[PATCH v2 3/4] crypto: add CONFIG_ symbol for rsa helper

2016-03-23 Thread Tudor Ambarus
All RSA implementations can now use the key extract symbols by selecting CRYPTO_RSA_HELPER. Signed-off-by: Tudor Ambarus --- crypto/Kconfig | 8 ++-- crypto/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index f6bfdda

[PATCH v2 4/4] crypto: rsa_helper - export symbols for asn1 structures

2016-03-23 Thread Tudor Ambarus
Export rsapubkey_decoder and rsaprivkey_decoder structures, since they can (will) be used by caam and qat drivers. Signed-off-by: Tudor Ambarus --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_helper.c index df1f480..d81a0ec 100644

[PATCH v2 2/4] crypto: rsa_helper - add raw integer parser actions

2016-03-23 Thread Tudor Ambarus
Dedicated to RSA (hardware) implementations that want to use raw integers instead of MPI keys. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 15 crypto/rsa_helper.c | 182 ++ include/crypto/internal/rsa.h | 28

[PATCH v2 0/4] crypto: rsa - generalize ASN.1 sequences

2016-03-23 Thread Tudor Ambarus
herent_key functions - export raw_rsa_get_ symbols Tudor Ambarus (4): crypto: rsa - generalize ASN.1 sequences crypto: rsa_helper - add raw integer parser actions crypto: add CONFIG_ symbol for rsa helper crypto: rsa_helper - export symbols for asn1 structures crypto/Kconfig

[PATCH v2 1/4] crypto: rsa - generalize ASN.1 sequences

2016-03-23 Thread Tudor Ambarus
ction pointers to specific actions. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 60 ++- crypto/rsa_helper.c | 166 -- include/crypto/internal/rsa.h | 31 ++-- 3 files changed, 194 insertions(+), 63 deletions(-)

[PATCH 10/10] crypto: caam - add support for RSA algorithm

2016-03-19 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc.c | 513 + drivers/crypto/caam/caampkc.h | 84

[PATCH 02/10] crypto: rsa_helper - add raw integer parser actions

2016-03-19 Thread Tudor Ambarus
Dedicated to RSA (hardware) implementations that want to use raw integers instead of MPI keys. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 15 crypto/rsa_helper.c | 158 ++ include/crypto/internal/rsa.h | 24

[PATCH 06/10] crypto: qat - fix address leaking of RSA public exponent

2016-03-19 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b/drivers/crypto/qat/qat_common/qat_asym_algs.c index 8dbbf084..05f49d4 100644 --- a/drivers/crypto

[PATCH 04/10] crypto: rsa_helper - export symbols for asn1 structures

2016-03-19 Thread Tudor Ambarus
Export rsapubkey_decoder and rsaprivkey_decoder structures, since they can (will) be used by caam and qat drivers. Signed-off-by: Tudor Ambarus --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_helper.c index 1708db8..14aef69 100644

[PATCH 01/10] crypto: rsa - generalize ASN.1 sequences

2016-03-19 Thread Tudor Ambarus
tions. Signed-off-by: Tudor Ambarus --- crypto/rsa.c | 48 + crypto/rsa_helper.c | 117 +- include/crypto/internal/rsa.h | 28 +++--- 3 files changed, 130 insertions(+), 63 deletions(-) diff --git a/crypto/rs

[PATCH 07/10] crypto: qat - remove duplicate ASN.1 parser

2016-03-19 Thread Tudor Ambarus
Use the RSA's software implementation parser with raw integer actions. Compile-tested only. Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/Kconfig| 3 +- drivers/crypto/qat/qat_common/Makefile| 10 +- drivers/crypto/qat/qat_common/qat_asym_a

[PATCH 03/10] crypto: add CONFIG_ symbol for rsa helper

2016-03-19 Thread Tudor Ambarus
All RSA implementations can now use the key extract symbols by selecting CRYPTO_RSA_HELPER. Signed-off-by: Tudor Ambarus --- crypto/Kconfig | 8 ++-- crypto/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/Kconfig b/crypto/Kconfig index f6bfdda

[PATCH 08/10] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-03-19 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros of RSA's algorithm output. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c

[PATCH 05/10] crypto: qat - avoid memory corruption or undefined behaviour

2016-03-19 Thread Tudor Ambarus
memcopying to a (null pointer + offset) will result in memory corruption or undefined behaviour. Signed-off-by: Tudor Ambarus --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/qat/qat_common/qat_asym_algs.c b

[PATCH 09/10] crypto: scatterwalk - export scatterwalk_pagedone

2016-03-19 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH v2 3/3] crypto: caam - add support for RSA algorithm

2016-02-24 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- v2: use kzfree instead of memset with zero and kfree. drivers/crypto/caam/Kconfig | 13 + drivers/crypto/caam/Makefile | 13 + drivers/crypto/caam/caam_rsaprivkey.asn1

[PATCH 3/3] crypto: caam - add support for RSA algorithm

2016-02-22 Thread Tudor Ambarus
Add RSA support to caam driver. Coauthored-by: Yashpal Dutta Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/Kconfig | 13 + drivers/crypto/caam/Makefile | 13 + drivers/crypto/caam/caam_rsaprivkey.asn1 | 11 + drivers/crypto/caam/caam_rsapubkey.asn1 | 4

[PATCH 2/3] crypto: scatterwalk - export scatterwalk_pagedone

2016-02-22 Thread Tudor Ambarus
Used in caam driver. Export the symbol since the caam driver can be built as a module. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/scatterwalk.c b/crypto

[PATCH 1/3] crypto: scatterwak - Add scatterwalk_sg_copychunks

2016-02-22 Thread Tudor Ambarus
This patch adds the function scatterwalk_sg_copychunks which writes a chunk of data from a scatterwalk to another scatterwalk. It will be used by caam driver to remove the leading zeros of RSA's algorithm output. Signed-off-by: Tudor Ambarus --- crypto/scatterwalk.c

[PATCH] crypto: caam - add support for rfc4543(gcm(aes))

2014-10-30 Thread Tudor Ambarus
Add AES-GMAC as an IPSec ESP mechanism to provide data origin authentication, but not confidentiality. This method is referred as ENCR_NULL_AUTH_AES_GMAC. Signed-off-by: Tudor Ambarus --- removed a blank line introduced in aead_encrypt function. drivers/crypto/caam/caamalg.c | 458

[PATCH] crypto: caam - add support for rfc4543(gcm(aes))

2014-10-30 Thread Tudor Ambarus
Add AES-GMAC as an IPSec ESP mechanism to provide data origin authentication, but not confidentiality. This method is referred as ENCR_NULL_AUTH_AES_GMAC. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caamalg.c | 459 +- 1 file changed, 458

[PATCH v2] crypto: caam - fix output sequence contiguity check

2014-10-24 Thread Tudor Ambarus
This patch fixes the assumption that output sequence is not contiguous when input sequence is not contiguous and in-place encryption is done. Output sequence does not need to be contiguous with associated data. Signed-off-by: Tudor Ambarus --- Substitute 'caam: caamalg' with 'c

[PATCH] caam: caamalg - fix output sequence contiguity check

2014-10-23 Thread Tudor Ambarus
This patch fixes the assumption that output sequence is not contiguous when input sequence is not contiguous and in-place encryption is done. Output sequence does not need to be contiguous with associated data. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caamalg.c | 3 ++- 1 file

[PATCH v3 2/2] crypto: caam - add support for rfc4106(gcm(aes))

2014-10-23 Thread Tudor Ambarus
Add Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) as an IPsec Encapsulating Security Payload (ESP) mechanism to provide confidentiality and data origin authentication. Signed-off-by: Tudor Ambarus --- This new patchset fixes rfc4106's input sequence format, when da

[PATCH v3 1/2] crypto: caam - add support for gcm(aes)

2014-10-23 Thread Tudor Ambarus
the GCM specification. Signed-off-by: Tudor Ambarus Signed-off-by: Horia Geanta --- This new patchset fixes GCM's input sequence format, when data is contiguous. drivers/crypto/caam/caamalg.c | 342 -- 1 file changed, 331 insertions(+), 11 dele

[PATCH 2/2] crypto: caam - add support for rfc4106(gcm(aes))

2014-10-15 Thread Tudor Ambarus
Add Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) as an IPsec Encapsulating Security Payload (ESP) mechanism to provide confidentiality and data origin authentication. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caamalg.c | 424

Re: [PATCH v2 2/2] crypto: caam - add support for rfc4106(gcm(aes))

2014-10-15 Thread Tudor Ambarus
On 10/14/2014 12:17 PM, Tudor Ambarus wrote: +static int rfc4106_setkey(struct crypto_aead *aead, + const u8 *key, unsigned int keylen) +{ + struct caam_ctx *ctx = crypto_aead_ctx(aead); + struct device *jrdev = ctx->jrdev; + int ret

[PATCH v2 2/2] crypto: caam - add support for rfc4106(gcm(aes))

2014-10-14 Thread Tudor Ambarus
Add Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) as an IPsec Encapsulating Security Payload (ESP) mechanism to provide confidentiality and data origin authentication. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caamalg.c | 423

[PATCH v2 1/2] crypto: caam - add support for gcm(aes)

2014-10-14 Thread Tudor Ambarus
the GCM specification. Signed-off-by: Tudor Ambarus Signed-off-by: Horia Geanta --- drivers/crypto/caam/caamalg.c | 331 -- 1 file changed, 321 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c

[PATCH 1/2] crypto: caam - add support for gcm(aes)

2014-10-09 Thread Tudor Ambarus
the GCM specification. Signed-off-by: Tudor Ambarus Signed-off-by: Horia Geanta --- drivers/crypto/caam/caamalg.c | 330 -- 1 file changed, 320 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c

[PATCH 2/2] crypto: caam - add support for rfc4106(gcm(aes))

2014-10-09 Thread Tudor Ambarus
Add Advanced Encryption Standard (AES) in Galois/Counter Mode (GCM) as an IPsec Encapsulating Security Payload (ESP) mechanism to provide confidentiality and data origin authentication. Signed-off-by: Tudor Ambarus --- drivers/crypto/caam/caamalg.c | 430

<    1   2   3