]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: caam - add support for RSA key form 3
authorRadu Alexe <radu.alexe@nxp.com>
Tue, 25 Apr 2017 13:26:39 +0000 (16:26 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 May 2017 05:19:51 +0000 (13:19 +0800)
commit5c86b1398aa0423073fce63fd6d1e94dc5ccc3da
tree6f8f46b162a0708dcf5b85884f02f7a1e1109683
parent8c2df1fb6a1fd032f43dc4b2f644f92312087b10
crypto: caam - add support for RSA key form 3

CAAM RSA private key may have either of three representations.

1. The first representation consists of the pair (n, d), where the
   components have the following meanings:
      n      the RSA modulus
      d      the RSA private exponent

2. The second representation consists of the triplet (p, q, d), where
the
   components have the following meanings:
      p      the first prime factor of the RSA modulus n
      q      the second prime factor of the RSA modulus n
      d      the RSA private exponent

3. The third representation consists of the quintuple (p, q, dP, dQ,
qInv),
   where the components have the following meanings:
      p      the first prime factor of the RSA modulus n
      q      the second prime factor of the RSA modulus n
      dP     the first factors's CRT exponent
      dQ     the second factors's CRT exponent
      qInv   the (first) CRT coefficient

The benefit of using the third or the second key form is lower
computational cost for the decryption and signature operations.

This patch adds support for the third RSA private key
representations and extends caampkc to use the fastest key when all
related components are present in the private key.

Signed-off-by: Tudor Ambarus <tudor-dan.ambarus@nxp.com>
Signed-off-by: Radu Alexe <radu.alexe@nxp.com>
Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caampkc.c
drivers/crypto/caam/caampkc.h
drivers/crypto/caam/pdb.h
drivers/crypto/caam/pkc_desc.c