[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 tudor.amba...@freescale.com --- drivers/crypto/caam/caamalg.c | 430

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

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

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

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

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

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

2014-10-23 Thread Tudor Ambarus
to the GCM specification. Signed-off-by: Tudor Ambarus tudor.amba...@freescale.com Signed-off-by: Horia Geanta horia.gea...@freescale.com --- This new patchset fixes GCM's input sequence format, when data is contiguous. drivers/crypto/caam/caamalg.c | 342

[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 tudor.amba...@freescale.com --- This new patchset fixes rfc4106's input sequence

[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 tudor.amba...@freescale.com --- drivers/crypto/caam

[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 tudor.amba...@freescale.com --- Substitute 'caam: caamalg

[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 tudor.amba...@freescale.com --- drivers/crypto/caam/caamalg.c | 459

[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 tudor.amba...@freescale.com --- removed a blank line introduced in aead_encrypt function. drivers/crypto/caam

[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 <tudor-dan.a

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

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc

[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 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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <tudor-dan.a

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

2016-06-15 Thread Tudor Ambarus
on 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 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 <tu

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <yashpal.du...@freescale.com>. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc

[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 <tudor-dan.amba...@nxp.com> --- 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 3

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatter

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <tudor-dan.amba...@nxp.com> --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cryp

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatter

[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 <tudor-dan.amba...@nxp.com> --- crypto/Kconfig | 8 ++-- crypto/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/Kco

[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 <tudor-dan.amba...@nxp.com> --- drivers/crypto/qat/Kconfig| 3 +- drivers/crypto/qat/qat_common/Makefile| 10 +- drivers/cryp

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

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

2016-04-06 Thread Tudor Ambarus
pointers to specific actions. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 60 ++- crypto/rsa_helper.c | 166 -- include/crypto/internal/rsa.h | 31 ++-- 3 files changed, 194 inse

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 15 crypto/rsa_helper.c | 182 ++ include/

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatter

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_he

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

2016-03-19 Thread Tudor Ambarus
. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 48 + crypto/rsa_helper.c | 117 +- include/crypto/internal/rsa.h | 28 +++--- 3 files changed, 130 insertions(+), 63 del

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_he

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caam

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 15 crypto/rsa_helper.c | 158 ++ include/

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatter

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

2016-03-23 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- 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..0

[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 <tudor-dan.amba...@nxp.com> --- drivers/crypto/qat/qat_common/qat_asym_algs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cryp

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

2016-03-23 Thread Tudor Ambarus
pointers to specific actions. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 60 ++- crypto/rsa_helper.c | 166 -- include/crypto/internal/rsa.h | 31 ++-- 3 files changed, 194 inse

[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 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 <tudor-dan.amba...@nxp.com> --- crypto/rsa.c | 15 crypto/rsa_helper.c | 182 ++ include/

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/rsa_helper.c b/crypto/rsa_he

[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 <tudor-dan.amba...@nxp.com> --- crypto/Kconfig | 8 ++-- crypto/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/crypto/Kco

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig| 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caam

[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 06/10] crypto: qat - fix address leaking of RSA public exponent

2016-03-19 Thread Tudor Ambarus
Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- 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..0

[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 <tudor-dan.amba...@nxp.com> --- crypto/rsa.c

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig| 12 ++ drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caam

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

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

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

2016-04-29 Thread Tudor Ambarus
e has been inserted, which is not the case here. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- 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_de

[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 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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

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

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig | 12 + drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caampkc

[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 <tudor-dan.amba...@nxp.com> --- crypto/scatterwalk.c | 5 +++-- include/crypto/scatterwalk.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/

[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 <yashpal.du...@freescale.com> Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- drivers/crypto/caam/Kconfig| 12 ++ drivers/crypto/caam/Makefile | 4 + drivers/crypto/caam/caam

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

[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 <tudor-dan.amba...@nxp.com> --- Changes from initial patch: -

[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 <yashpal.du...@freescale.com>. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- 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

[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 <yashpal.du...@freescale.com>. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- Changes in v10: - remove unused asn1 header files Changes in v9: - do not drop leading zeros for the RSA output. Changes in

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

2016-09-30 Thread Tudor Ambarus
!= caam endianness. Signed-off-by: Tudor Ambarus <tudor-dan.amba...@nxp.com> --- 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(-)

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

Re: [PATCH v8 4/4] crypto: algif_akcipher - enable compilation

2017-08-11 Thread Tudor Ambarus
Hi, Stephan, On 08/10/2017 09:40 AM, Stephan Müller wrote: Add the Makefile and Kconfig updates to allow algif_akcipher to be compiled. Signed-off-by: Stephan Mueller --- crypto/Kconfig | 9 + crypto/Makefile | 1 + 2 files changed, 10 insertions(+) Any

Re: [PATCH v8 3/4] crypto: AF_ALG -- add asymmetric cipher

2017-08-11 Thread Tudor Ambarus
Hi, Stephan, On 08/10/2017 09:40 AM, Stephan Müller wrote: This patch adds the user space interface for asymmetric ciphers. The interface allows the use of sendmsg as well as vmsplice to provide data. The akcipher interface implementation uses the common AF_ALG interface code regarding TX and

Re: [PATCH v8 1/4] crypto: AF_ALG -- add sign/verify API

2017-08-10 Thread Tudor Ambarus
On 08/10/2017 04:03 PM, Stephan Mueller wrote: Is there a style requirement for that? checkpatch.pl does not complain. I thought that one liners in a conditional should not have braces? Linux coding style requires braces in both branches when you have a branch with a statement and the other

Re: [PATCH v8 1/4] crypto: AF_ALG -- add sign/verify API

2017-08-10 Thread Tudor Ambarus
Hi, Stephan, On 08/10/2017 09:39 AM, Stephan Müller wrote: Add the flags for handling signature generation and signature verification. The af_alg helper code as well as the algif_skcipher and algif_aead code must be changed from a boolean indicating the cipher operation to an integer because

Re: [v3 RFC PATCH 2/2] crypto: ecc: use caller's GFP flags

2017-07-18 Thread Tudor Ambarus
Hi, Herbert, On 07/18/2017 08:52 AM, Herbert Xu wrote: On Wed, Jun 28, 2017 at 05:08:36PM +0300, Tudor Ambarus wrote: Using GFP_KERNEL when allocating data and implicitly assuming that we can sleep was wrong because the caller could be in atomic context. Let the caller decide whether sleeping

Re: [v3 RFC PATCH 1/2] crypto: ecdh: fix concurrency on ecdh_ctx

2017-07-18 Thread Tudor Ambarus
Hi, Herbert, On 07/18/2017 08:50 AM, Herbert Xu wrote: On Wed, Jun 28, 2017 at 05:08:35PM +0300, Tudor Ambarus wrote: ecdh_ctx contained static allocated data for the shared secret, for the public and private key. When talking about shared secret and public key, they were doomed

Re: [PATCH] Crypto: atmel-ecc: Make a couple of local functions static

2017-07-20 Thread Tudor Ambarus
symbol 'atmel_ecc_i2c_client_alloc' was not declared. Should it be static? symbol 'atmel_ecc_i2c_client_free' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.k...@canonical.com> Acked-by: Tudor Ambarus <tudor.amba...@microchip.com> Thanks, ta

[PATCH] crypto: ecdh: fix concurrency on shared secret and pubkey

2017-07-20 Thread Tudor Ambarus
-request dynamically allocated shared secret and public key. Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> --- crypto/ecdh.c | 51 +-- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/crypto/ecdh.c b/crypto/ecdh.c index 6

[PATCH] crypto: atmel-ecc: fix signed integer to u8 assignment

2017-07-20 Thread Tudor Ambarus
<dan.carpen...@oracle.com> Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> --- drivers/crypto/atmel-ecc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/atmel-ecc.c b/drivers/crypto/atmel-ecc.c index 66ab1021..647a994 100644 --- a/dr

Re: KPP questions and confusion

2017-07-28 Thread Tudor Ambarus
Hi, Marcel, Kyle, On 07/17/2017 09:17 PM, Marcel Holtmann wrote: Hi Kyle, I am confused about several things in the new key agreement code. net/bluetooth/smp.c in two places generates random bytes for the private_key argument to net/bluetooth/ecdh_helper.c:generate_ecdh_keys, which suggests

Re: wait in atomic context for an i2c crypto device to finish its execution

2017-06-29 Thread Tudor Ambarus
On 29.06.2017 13:12, Gilad Ben-Yossef wrote: Perhaps I missed something but it sounds like a classic case to use a work queue: Makes sense, thanks! ta

Re: [PATCH 0/3] crypto: introduce Microchip / Atmel ECC driver

2017-07-05 Thread Tudor Ambarus
Hi, Marcel, On 05.07.2017 13:54, Marcel Holtmann wrote: Hi Tudor, This patch set introduces Microchip / Atmel ECC driver. The first patch adds some helpers that will be used by fallbacks to kpp software implementations. The second patch adds ECDH support for the ATECC508A (I2C)

[PATCH 1/3] crypto: kpp: add get/set_flags helpers

2017-07-05 Thread Tudor Ambarus
These helpers will be used for fallbacks to kpp software implementations. Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> --- include/crypto/kpp.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/crypto/kpp.h b/include/crypto/kpp.h index 2133d17..1bde0a6

[PATCH 0/3] crypto: introduce Microchip / Atmel ECC driver

2017-07-05 Thread Tudor Ambarus
never be known outside of the device. If the user wants to use its own private keys, the driver will fallback to the ecdh software implementation. Tudor Ambarus (3): crypto: kpp: add get/set_flags helpers crypto: introduce Microchip / Atmel ECC driver MAINTAINERS: add a maintainer

[PATCH 3/3] MAINTAINERS: add a maintainer for Microchip / Atmel ECC driver

2017-07-05 Thread Tudor Ambarus
A new cryptographic engine driver was added in drivers/crypto/atmel-ecc.*. Add myself as a maintainer for this driver. Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index a

Re: [RFC PATCH] crypto: ecdh: fix concurrency on ecdh_ctx

2017-06-28 Thread Tudor Ambarus
Hi, On 22.06.2017 14:03, Tudor Ambarus wrote: ecdh_ctx contained static allocated data for the shared secret, for the public and private key. When talking about shared secret and public key, they were doomed to concurrency issues because they could be shared by multiple crypto requests

wait in atomic context for an i2c crypto device to finish its execution

2017-06-29 Thread Tudor Ambarus
Hi, Herbert, all, I need an advice. I'm writing a driver for a crypto device that communicates over I2C. Reads and writes from/to the i2c device are sequential, I use a lock to synchronize the requests. There are no interrupts for the i2c client. Each request has to send a command, to wait for

[v2 RFC PATCH 1/2] crypto: ecdh: fix concurrency on ecdh_ctx

2017-06-28 Thread Tudor Ambarus
From: Tudor Ambarus <tudor.amba...@microchip.com> ecdh_ctx contained static allocated data for the shared secret, for the public and private key. When talking about shared secret and public key, they were doomed to concurrency issues because they could be shared by multiple crypto re

[v3 RFC PATCH 0/2] crypto: ecdh, ecc fixes

2017-06-28 Thread Tudor Ambarus
the user decide if sleeping is permitted - kmalloc instead of kzalloc for the private key - add "crypto: ecc: use caller's GFP flags" patch v1 can be found at: http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg26149.html Tudor Ambarus (2): crypto: ecdh: fix concurrency o

[v3 RFC PATCH 1/2] crypto: ecdh: fix concurrency on ecdh_ctx

2017-06-28 Thread Tudor Ambarus
. With this, the private key will always point to a valid key, but to what setkey call it belongs, is the responsibility of the caller, as it is now in all crypto framework. Signed-off-by: Tudor Ambarus <tudor.amba...@microchip.com> --- crypto/ecc.h | 2 -- crypto/ecdh.

[v2 RFC PATCH 0/2] crypto: ecdh, ecc fixes

2017-06-28 Thread Tudor Ambarus
for the private key - add "crypto: ecc: use caller's GFP flags" patch v1 can be found at: http://www.mail-archive.com/linux-crypto@vger.kernel.org/msg26149.html Tudor Ambarus (2): crypto: ecdh: fix concurrency on ecdh_ctx crypto: ecc: use caller's GFP flags crypto/e

[v2 RFC PATCH 2/2] crypto: ecc: use caller's GFP flags

2017-06-28 Thread Tudor Ambarus
-by: Tudor Ambarus <tudor.amba...@gmail.com> --- crypto/ecc.c | 22 +++--- crypto/ecc.h | 6 -- crypto/ecdh.c | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 633a9bc..9501a56 100644 --- a/crypto/ecc.c +++ b/

[v3 RFC PATCH 2/2] crypto: ecc: use caller's GFP flags

2017-06-28 Thread Tudor Ambarus
-by: Tudor Ambarus <tudor.amba...@microchip.com> --- crypto/ecc.c | 22 +++--- crypto/ecc.h | 6 -- crypto/ecdh.c | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/crypto/ecc.c b/crypto/ecc.c index 633a9bc..9501a56 100644 --- a/crypto/ecc.c +++ b/

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: [PATCH 0/6] Add support for ECDSA algorithm

2017-08-22 Thread Tudor Ambarus
Hi, Herbert, On 02/02/2017 03:57 PM, Herbert Xu wrote: Yes but RSA had an in-kernel user in the form of module signature verification. We don't add algorithms to the kernel without actual users. So this patch-set needs to come with an actual in-kernel user of ECDSA. ECDSA can be used by the

Re: [PATCH 0/6] Add support for ECDSA algorithm

2017-08-23 Thread Tudor Ambarus
Hi, Sandy, On 08/22/2017 08:22 PM, Sandy Harris wrote: On Tue, Aug 22, 2017 at 12:14 PM, Tudor Ambarus <tudor.amba...@microchip.com> wrote: Hi, Herbert, On 02/02/2017 03:57 PM, Herbert Xu wrote: Yes but RSA had an in-kernel user in the form of module signature verification. We don

Re: [PATCH v8 0/4] crypto: add algif_akcipher user space API

2017-08-17 Thread Tudor Ambarus
Hi, all, On 08/11/2017 07:05 PM, Marcel Holtmann wrote: Hi Stephan, AF_ALG is best suited for crypto use cases where a socket is set up once and there are lots of reads and writes to justify the setup cost. With asymmetric crypto, the setup cost is high when you might only use the socket for

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 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 <tudor.amba...@microchip.com> --- crypto/ecc.c | 12 ++-- crypto/ecc.h

  1   2   3   >