Go to the documentation of this file.
31 #ifndef _PIC32MZ_CRYPTO_PKC_H
32 #define _PIC32MZ_CRYPTO_PKC_H
38 #ifndef PIC32MZ_CRYPTO_PKC_SUPPORT
39 #define PIC32MZ_CRYPTO_PKC_SUPPORT DISABLED
40 #elif (PIC32MZ_CRYPTO_PKC_SUPPORT != ENABLED && PIC32MZ_CRYPTO_PKC_SUPPORT != DISABLED)
41 #error PIC32MZ_CRYPTO_PKC_SUPPORT parameter is not valid
45 #define BA414E_GET_SCM_SLOT(n) ((uint32_t *) __CRYPTO1SCM_BASE + ((n) * 16))
48 #define BA414E_MOD_SLOT_P 0
49 #define BA414E_MOD_SLOT_A 1
50 #define BA414E_MOD_SLOT_B 2
51 #define BA414E_MOD_SLOT_C 3
54 #define BA414E_RSA_MOD_EXP_SLOT_P 0
55 #define BA414E_RSA_MOD_EXP_SLOT_A 1
56 #define BA414E_RSA_MOD_EXP_SLOT_E 2
57 #define BA414E_RSA_MOD_EXP_SLOT_C 3
60 #define BA414E_ECC_SLOT_P 0
61 #define BA414E_ECC_SLOT_N 1
62 #define BA414E_ECC_SLOT_GX 2
63 #define BA414E_ECC_SLOT_GY 3
64 #define BA414E_ECC_SLOT_A 4
65 #define BA414E_ECC_SLOT_B 5
66 #define BA414E_ECC_SLOT_P1X 6
67 #define BA414E_ECC_SLOT_P1Y 7
68 #define BA414E_ECC_SLOT_P2X 8
69 #define BA414E_ECC_SLOT_P2Y 9
70 #define BA414E_ECC_SLOT_P3X 10
71 #define BA414E_ECC_SLOT_P3Y 11
72 #define BA414E_ECC_SLOT_K 12
75 #define BA414E_ECDSA_SLOT_P 0
76 #define BA414E_ECDSA_SLOT_N 1
77 #define BA414E_ECDSA_SLOT_GX 2
78 #define BA414E_ECDSA_SLOT_GY 3
79 #define BA414E_ECDSA_SLOT_A 4
80 #define BA414E_ECDSA_SLOT_B 5
81 #define BA414E_ECDSA_SLOT_D 6
82 #define BA414E_ECDSA_SLOT_K 7
83 #define BA414E_ECDSA_SLOT_QX 8
84 #define BA414E_ECDSA_SLOT_QY 9
85 #define BA414E_ECDSA_SLOT_R 10
86 #define BA414E_ECDSA_SLOT_S 11
87 #define BA414E_ECDSA_SLOT_H 12
88 #define BA414E_ECDSA_SLOT_W 13
89 #define BA414E_ECDSA_SLOT_P1X 14
90 #define BA414E_ECDSA_SLOT_P1Y 15
93 #define BA414E_CURVE25519_SLOT_P 0
94 #define BA414E_CURVE25519_SLOT_X1 2
95 #define BA414E_CURVE25519_SLOT_A24 3
96 #define BA414E_CURVE25519_SLOT_K 4
97 #define BA414E_CURVE25519_SLOT_X3 6
100 #define BA414E_ED25519_SLOT_P 0
101 #define BA414E_ED25519_SLOT_D2 1
102 #define BA414E_ED25519_SLOT_PX 2
103 #define BA414E_ED25519_SLOT_PY 3
104 #define BA414E_ED25519_SLOT_E 4
105 #define BA414E_ED25519_SLOT_CX 6
106 #define BA414E_ED25519_SLOT_CY 7
109 #define PKCOMMAND_OPSIZE_128B 0x00000200
110 #define PKCOMMAND_OPSIZE_256B 0x00000400
111 #define PKCOMMAND_OPSIZE_512B 0x00000800
114 #define PKCOMMAND_OP_MOD_ADD 0x00000001
115 #define PKCOMMAND_OP_MOD_SUB 0x00000002
116 #define PKCOMMAND_OP_MOD_MUL_ODD 0x00000003
117 #define PKCOMMAND_OP_MOD_RED_ODD 0x00000004
118 #define PKCOMMAND_OP_MOD_DIV_ODD 0x00000005
119 #define PKCOMMAND_OP_MOD_INV_ODD 0x00000006
120 #define PKCOMMAND_OP_MUL 0x00000008
121 #define PKCOMMAND_OP_MOD_INV_EVEN 0x00000009
122 #define PKCOMMAND_OP_RSA_MOD_EXP 0x00000010
123 #define PKCOMMAND_OP_RSA_PRIV_KEY_GEN 0x00000011
124 #define PKCOMMAND_OP_ECC_POINT_DBL 0x00000020
125 #define PKCOMMAND_OP_ECC_POINT_ADD 0x00000021
126 #define PKCOMMAND_OP_ECC_POINT_MUL 0x00000022
127 #define PKCOMMAND_OP_ECC_CHECK_AB 0x00000023
128 #define PKCOMMAND_OP_ECC_POINT_N 0x00000024
129 #define PKCOMMAND_OP_ECC_CHECK_RS 0x00000025
130 #define PKCOMMAND_OP_ECC_CHECK_POINT 0x00000026
131 #define PKCOMMAND_OP_CURVE25519_POINT_MUL 0x00000028
132 #define PKCOMMAND_OP_ED25519_XRECOVER 0x00000029
133 #define PKCOMMAND_OP_ED25519_SCALAR_MUL 0x0000002A
134 #define PKCOMMAND_OP_ED25519_CHECK_VALID 0x0000002B
135 #define PKCOMMAND_OP_ED25519_CHECK_POINT 0x0000002C
136 #define PKCOMMAND_OP_ECDSA_SIGN_GEN 0x00000030
137 #define PKCOMMAND_OP_ECDSA_SIGN_VERIFY 0x00000031
138 #define PKCOMMAND_OP_ECDSA_PARAMS_VALID 0x00000032
General definitions for cryptographic algorithms.
void ba414eClearScm(void)