summaryrefslogtreecommitdiff
path: root/crypto/dh.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2016-06-29 19:32:21 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2016-07-01 23:45:18 +0800
commitebff06f6e2a1ae1c8454d9f59d5d6b535d9fc70e (patch)
treeec3e62c31cf2f9891c67d8a262157a0d0469594c /crypto/dh.c
parentbffd0517057a4d592fe651de53210b30a5fb5252 (diff)
downloadlinux-crypto-ebff06f6e2a1ae1c8454d9f59d5d6b535d9fc70e.tar.gz
linux-crypto-ebff06f6e2a1ae1c8454d9f59d5d6b535d9fc70e.zip
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>
Diffstat (limited to 'crypto/dh.c')
-rw-r--r--crypto/dh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/dh.c b/crypto/dh.c
index 5e960fe2..9d19360e 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -129,7 +129,7 @@ static int dh_compute_value(struct kpp_request *req)
if (ret)
goto err_free_base;
- ret = mpi_write_to_sgl(val, req->dst, &req->dst_len, &sign);
+ ret = mpi_write_to_sgl(val, req->dst, req->dst_len, &sign);
if (ret)
goto err_free_base;