diff options
author | Yashpal Dutta <yashpal.dutta@freescale.com> | 2014-03-22 22:59:34 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-03-24 16:09:35 (GMT) |
commit | fc281aa59e4c6f2e1574d4a6812438a6e06be0a9 (patch) | |
tree | fa46b059eae0492f4a78bf3d65bc04560f9397c2 /drivers/crypto/caam/pdb.h | |
parent | 67659d841becfc172216df76f058db25588f87cf (diff) | |
download | linux-fsl-qoriq-fc281aa59e4c6f2e1574d4a6812438a6e06be0a9.tar.xz |
added support for PKC keygen
As a part of PKC support, RSA, DSA DH, ECDH, ECDSA requires key
generation. The patch adds support for key generation support
for DSA, ECDSA, DH, ECDH.
The patch adds DH operation support too
Signed-off-by: Yashpal Dutta <yashpal.dutta@freescale.com>
Change-Id: I0dc9c144a23e2248bf8974a1615363341dc4886e
Reviewed-on: http://git.am.freescale.net:8181/5867
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Geanta Neag Horia Ioan-B05471 <horia.geanta@freescale.com>
Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/9551
Reviewed-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/crypto/caam/pdb.h')
-rw-r--r-- | drivers/crypto/caam/pdb.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/crypto/caam/pdb.h b/drivers/crypto/caam/pdb.h index 7cf2662..0680b30 100644 --- a/drivers/crypto/caam/pdb.h +++ b/drivers/crypto/caam/pdb.h @@ -400,6 +400,17 @@ struct dsa_verify_desc_s { uint32_t op; } __packed; +struct dlc_keygen_desc_s { + uint32_t desc_hdr; + uint32_t sgf_ln; + dma_addr_t q_dma; + dma_addr_t r_dma; + dma_addr_t g_dma; + dma_addr_t s_dma; + dma_addr_t w_dma; + uint32_t op; +} __packed; + struct ecdsa_sign_desc_s { uint32_t desc_hdr; uint32_t sgf_ln; /* Use ECDSA_PDB_ definitions per above */ @@ -429,6 +440,42 @@ struct ecdsa_verify_desc_s { uint32_t op; } __packed; +struct ecc_keygen_desc_s { + uint32_t desc_hdr; + uint32_t sgf_ln; + dma_addr_t q_dma; + dma_addr_t r_dma; + dma_addr_t g_dma; + dma_addr_t s_dma; + dma_addr_t w_dma; + dma_addr_t ab_dma; + uint32_t op; +} __packed; + +#define DH_PDB_L_SHIFT 7 +#define DH_PDB_L_MASK (0x3ff << DH_PDB_L_SHIFT) +#define DH_PDB_N_MASK 0x7f +#define DH_PDB_SGF_SHIFT 24 +#define DH_PDB_SGF_MASK (0xff << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_Q (0x80 << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_R (0x40 << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_W (0x20 << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_S (0x10 << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_Z (0x08 << DH_PDB_SGF_SHIFT) +#define DH_PDB_SGF_AB (0x04 << DH_PDB_SGF_SHIFT) + +struct dh_key_desc_s { + uint32_t desc_hdr; + uint32_t sgf_ln; /* Use DH_PDB_ definitions per above */ + dma_addr_t q_dma; + dma_addr_t r_dma; + dma_addr_t w_dma; + dma_addr_t s_dma; + dma_addr_t z_dma; + dma_addr_t ab_dma; + uint32_t op; +} __packed; + /* DSA/ECDSA Protocol Data Blocks */ #define RSA_PDB_SGF_SHIFT 28 #define RSA_PDB_MSG_FMT_SHIFT 12 |