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 --- crypto/ecc.c | 12 ++-- crypto/ecc.h | 4

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

2017-05-12 Thread Tudor Ambarus
The first two patches fix some typos and remove unused function arguments. The next three remove some unnecessary casts for the ecc keys. The next two fix the max_size() implemtations for (ec)dh. They were missing the check if the key was set. The last one allows other algorithms to use the

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

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

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

[PATCH 7/8] crypto: ecdh - fix ecdh_max_size

2017-05-12 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

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

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 | 6 +++--- crypto/ecc.h | 2 +-

[PATCH 6/8] crypto: dh - fix dh_max_size

2017-05-12 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 7cec0498..325a5dd 100644

[PATCH 8/8] crypto: ecc - don't be selfish on pubkeys

2017-05-12 Thread Tudor Ambarus
Rename ecdh_make_pub_key() to ecc_make_pub_key(). This function might as well be used by ecdsa. Signed-off-by: Tudor Ambarus --- crypto/ecc.c | 4 ++-- crypto/ecc.h | 4 ++-- crypto/ecdh.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread Mike Frysinger
On Fri, May 12, 2017 at 3:06 AM, PrasannaKumar Muralidharan wrote: > On 12 May 2017 at 12:22, PrasannaKumar Muralidharan wrote: > > On 12 May 2017 at 12:11, Mike Frysinger wrote: > >> On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: > >>> On 12 May 2017 at 09:47, Mike Frysinger

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 13:17, Mike Frysinger wrote: >> Completely untested patch below. Will something like this work? >> >> --- a/drivers/char/hw_random/tpm-rng.c >> +++ b/drivers/char/hw_random/tpm-rng.c >> @@ -35,7 +35,13 @@ static int tpm_rng_read(struct hwrng *rng, void >>

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread Mike Frysinger
On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: > On 12 May 2017 at 09:47, Mike Frysinger wrote: > > From: Mike Frysinger > > > > If you build in hwrng & tpm-rng, but boot on a system that doesn't > > have a tpm (like via KVM), hwrng

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 12:22, PrasannaKumar Muralidharan wrote: > On 12 May 2017 at 12:11, Mike Frysinger wrote: >> On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: >>> On 12 May 2017 at 09:47, Mike Frysinger

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 09:47, Mike Frysinger wrote: > From: Mike Frysinger > > If you build in hwrng & tpm-rng, but boot on a system that doesn't > have a tpm (like via KVM), hwrng will spam the logs every 10 seconds > with the line: > hwrng: no data

Re: [PATCH] hwrng: do not warn when there are no devices

2017-05-12 Thread PrasannaKumar Muralidharan
On 12 May 2017 at 12:11, Mike Frysinger wrote: > On Fri, May 12, 2017 at 2:15 AM, PrasannaKumar Muralidharan wrote: >> On 12 May 2017 at 09:47, Mike Frysinger wrote: >> > From: Mike Frysinger >> > >> > If you build in hwrng & tpm-rng,

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 |

[PATCH 13/36] docs-rst: add crypto API book to pdf output

2017-05-12 Thread Mauro Carvalho Chehab
The crypto API book was added without the bits required to generate PDF output. Add them. Signed-off-by: Mauro Carvalho Chehab --- Documentation/conf.py| 2 ++ Documentation/crypto/conf.py | 10 ++ 2 files changed, 12 insertions(+) create mode 100644

[PATCH] Documentation: crypto: Fixed bugs, added example usage of calc_hash().

2017-05-12 Thread Kamil Konieczny
- Fixed bugs in example for shash and rng (added missing "*" and " *"). - Corrected pr_info() in calc_hash(). - Added example usage of calc_hash(). - No need for negate PTR_ERR to get error code, as crypto_alloc_rng already returns negative values like ERR_PTR(-ENOMEM). Fixed. Signed-off-by: