diff mbox series

[14/18] lib/mpi: export mpi_rshift

Message ID 20211201004858.19831-15-nstange@suse.de (mailing list archive)
State Superseded
Delegated to: Herbert Xu
Headers show
Series crypto: dh - infrastructure for NVM in-band auth and FIPS conformance | expand

Commit Message

Nicolai Stange Dec. 1, 2021, 12:48 a.m. UTC
A subsequent patch will make the crypto/dh's dh_is_pubkey_valid() to
calculate a safe-prime groups Q parameter from P: Q = (P - 1) / 2. For
implementing this, mpi_rshift() will be needed. Export it so that it's
accessible from crypto/dh.

Signed-off-by: Nicolai Stange <nstange@suse.de>
---
 lib/mpi/mpi-bit.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Hannes Reinecke Dec. 1, 2021, 7:32 a.m. UTC | #1
On 12/1/21 1:48 AM, Nicolai Stange wrote:
> A subsequent patch will make the crypto/dh's dh_is_pubkey_valid() to
> calculate a safe-prime groups Q parameter from P: Q = (P - 1) / 2. For
> implementing this, mpi_rshift() will be needed. Export it so that it's
> accessible from crypto/dh.
> 
> Signed-off-by: Nicolai Stange <nstange@suse.de>
> ---
>   lib/mpi/mpi-bit.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/lib/mpi/mpi-bit.c b/lib/mpi/mpi-bit.c
> index 142b680835df..070ba784c9f1 100644
> --- a/lib/mpi/mpi-bit.c
> +++ b/lib/mpi/mpi-bit.c
> @@ -242,6 +242,7 @@ void mpi_rshift(MPI x, MPI a, unsigned int n)
>   	}
>   	MPN_NORMALIZE(x->d, x->nlimbs);
>   }
> +EXPORT_SYMBOL_GPL(mpi_rshift);
>   
>   /****************
>    * Shift A by COUNT limbs to the left
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/lib/mpi/mpi-bit.c b/lib/mpi/mpi-bit.c
index 142b680835df..070ba784c9f1 100644
--- a/lib/mpi/mpi-bit.c
+++ b/lib/mpi/mpi-bit.c
@@ -242,6 +242,7 @@  void mpi_rshift(MPI x, MPI a, unsigned int n)
 	}
 	MPN_NORMALIZE(x->d, x->nlimbs);
 }
+EXPORT_SYMBOL_GPL(mpi_rshift);
 
 /****************
  * Shift A by COUNT limbs to the left