Go to the documentation of this file.
31 #ifndef _PIC32MZ_CRYPTO_H
32 #define _PIC32MZ_CRYPTO_H
38 #ifndef PIC32MZ_CRYPTO_BUFFER_SIZE
39 #define PIC32MZ_CRYPTO_BUFFER_SIZE 1024
40 #elif (PIC32MZ_CRYPTO_BUFFER_SIZE < 64)
41 #error PIC32MZ_CRYPTO_BUFFER_SIZE parameter is not valid
45 #define BD_CTRL_DESC_EN 0x80000000
46 #define BD_CTRL_CRY_MODE 0x38000000
47 #define BD_CTRL_CRY_MODE_NORMAL 0x00000000
48 #define BD_CTRL_CRY_MODE_PREBOOT_AUTH 0x08000000
49 #define BD_CTRL_CRY_MODE_KEK 0x10000000
50 #define BD_CTRL_CRY_MODE_CEK 0x18000000
51 #define BD_CTRL_SA_FETCH_EN 0x00400000
52 #define BD_CTRL_LAST_BD 0x00080000
53 #define BD_CTRL_LIFM 0x00040000
54 #define BD_CTRL_PKT_INT_EN 0x00020000
55 #define BD_CTRL_CBD_INT_EN 0x00010000
56 #define BD_CTRL_BD_BUFLEN 0x0000FFFF
59 #define SA_CTRL_VERIFY 0x20000000
60 #define SA_CTRL_NO_RX 0x08000000
61 #define SA_CTRL_OR_EN 0x04000000
62 #define SA_CTRL_ICVONLY 0x02000000
63 #define SA_CTRL_IRFLAG 0x01000000
64 #define SA_CTRL_LNC 0x00800000
65 #define SA_CTRL_LOADIV 0x00400000
66 #define SA_CTRL_FB 0x00200000
67 #define SA_CTRL_FLAGS 0x00100000
68 #define SA_CTRL_ALGO 0x0001FC00
69 #define SA_CTRL_ALGO_DES 0x00000400
70 #define SA_CTRL_ALGO_TDES 0x00000800
71 #define SA_CTRL_ALGO_AES 0x00001000
72 #define SA_CTRL_ALGO_MD5 0x00002000
73 #define SA_CTRL_ALGO_SHA1 0x00004000
74 #define SA_CTRL_ALGO_SHA256 0x00008000
75 #define SA_CTRL_ALGO_HMAC 0x00010000
76 #define SA_CTRL_ENC 0x00000200
77 #define SA_CTRL_KEYSIZE 0x00000180
78 #define SA_CTRL_KEYSIZE_128 0x00000000
79 #define SA_CTRL_KEYSIZE_192 0x00000080
80 #define SA_CTRL_KEYSIZE_256 0x00000100
81 #define SA_CTRL_MULTITASK 0x00000070
82 #define SA_CTRL_MULTITASK_NO_PASS 0x00000000
83 #define SA_CTRL_MULTITASK_PIPE_PASS 0x00000050
84 #define SA_CTRL_MULTITASK_PARALLEL_PASS 0x00000070
85 #define SA_CTRL_CRYPTOALGO 0x0000000F
86 #define SA_CTRL_CRYPTOALGO_ECB 0x00000000
87 #define SA_CTRL_CRYPTOALGO_CBC 0x00000001
88 #define SA_CTRL_CRYPTOALGO_CFB 0x00000002
89 #define SA_CTRL_CRYPTOALGO_OFB 0x00000003
90 #define SA_CTRL_CRYPTOALGO_TECB 0x00000004
91 #define SA_CTRL_CRYPTOALGO_TCBC 0x00000005
92 #define SA_CTRL_CRYPTOALGO_TCFB 0x00000006
93 #define SA_CTRL_CRYPTOALGO_TOFB 0x00000007
94 #define SA_CTRL_CRYPTOALGO_RECB 0x00000008
95 #define SA_CTRL_CRYPTOALGO_RCBC 0x00000009
96 #define SA_CTRL_CRYPTOALGO_RCFB 0x0000000A
97 #define SA_CTRL_CRYPTOALGO_ROFB 0x0000000B
98 #define SA_CTRL_CRYPTOALGO_RCBC_MAC 0x0000000C
99 #define SA_CTRL_CRYPTOALGO_RCTR 0x0000000D
100 #define SA_CTRL_CRYPTOALGO_AES_GCM 0x0000000E
130 uint32_t SA_AUTHKEY[8];
131 uint32_t SA_ENCKEY[8];
132 uint32_t SA_AUTHIV[8];
133 uint32_t SA_ENCIV[8];
OsMutex pic32mzCryptoMutex
General definitions for cryptographic algorithms.
error_t pic32mzCryptoInit(void)
Initialize hardware cryptographic accelerator.