diff options
author | Salvatore Benedetto | 2016-07-04 17:21:38 +0100 |
---|---|---|
committer | Herbert Xu | 2016-07-05 23:05:26 +0800 |
commit | 8be0b84e58a9b07c314f920792926c5c5a53d3da (patch) | |
tree | c75ddebfc0ea68a3cd05bc8bbf2dc2b85bdfb462 /include/crypto/internal/rsa.h | |
parent | e24860f2a6b50eb09f3a627e168433005798f8d9 (diff) |
crypto: rsa - Store rest of the private key components
When parsing a private key, store all non-optional fields. These
are required for enabling CRT mode for decrypt and verify
Signed-off-by: Salvatore Benedetto <salvatore.benedetto@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto/internal/rsa.h')
-rw-r--r-- | include/crypto/internal/rsa.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/crypto/internal/rsa.h b/include/crypto/internal/rsa.h index d6c042a2ee52..9e8f1590de98 100644 --- a/include/crypto/internal/rsa.h +++ b/include/crypto/internal/rsa.h @@ -19,17 +19,37 @@ * @n : RSA modulus raw byte stream * @e : RSA public exponent raw byte stream * @d : RSA private exponent raw byte stream + * @p : RSA prime factor p of n raw byte stream + * @q : RSA prime factor q of n raw byte stream + * @dp : RSA exponent d mod (p - 1) raw byte stream + * @dq : RSA exponent d mod (q - 1) raw byte stream + * @qinv : RSA CRT coefficient q^(-1) mod p raw byte stream * @n_sz : length in bytes of RSA modulus n * @e_sz : length in bytes of RSA public exponent * @d_sz : length in bytes of RSA private exponent + * @p_sz : length in bytes of p field + * @q_sz : length in bytes of q field + * @dp_sz : length in bytes of dp field + * @dq_sz : length in bytes of dq field + * @qinv_sz : length in bytes of qinv field */ struct rsa_key { const u8 *n; const u8 *e; const u8 *d; + const u8 *p; + const u8 *q; + const u8 *dp; + const u8 *dq; + const u8 *qinv; size_t n_sz; size_t e_sz; size_t d_sz; + size_t p_sz; + size_t q_sz; + size_t dp_sz; + size_t dq_sz; + size_t qinv_sz; }; int rsa_parse_pub_key(struct rsa_key *rsa_key, const void *key, |