• Radu Alexe's avatar
    crypto: caam - add support for RSA key form 3 · 4a651b12
    Radu Alexe authored
    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: default avatarTudor Ambarus <tudor-dan.ambarus@nxp.com>
    Signed-off-by: default avatarRadu Alexe <radu.alexe@nxp.com>
    Signed-off-by: default avatarHoria Geantă <horia.geanta@nxp.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    4a651b12
pkc_desc.c 2.29 KB