mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]>
This commit is contained in:
parent
50d2b643ea
commit
9b45b7bba3
4 changed files with 32 additions and 35 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue