]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: rsa - Generate fixed-length output
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 29 Jun 2016 11:32:21 +0000 (19:32 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 1 Jul 2016 15:45:18 +0000 (23:45 +0800)
commit5a98e4349ba8948102c5ef631f1663aa307df830
tree589fa304ec152558fc189f2da773154bd334e64c
parent9e839dc1a36322b40a85145de56344867a21347c
crypto: rsa - Generate fixed-length output

Every implementation of RSA that we have naturally generates
output with leading zeroes.  The one and only user of RSA,
pkcs1pad wants to have those leading zeroes in place, in fact
because they are currently absent it has to write those zeroes
itself.

So we shouldn't be stripping leading zeroes in the first place.
In fact this patch makes rsa-generic produce output with fixed
length so that pkcs1pad does not need to do any extra work.

This patch also changes DH to use the new interface.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/dh.c
crypto/rsa.c
include/linux/mpi.h
lib/mpi/mpicoder.c