nu_crypto.h 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456
  1. /**************************************************************************//**
  2. * @file crypto.h
  3. * @version V1.10
  4. * @brief Cryptographic Accelerator driver header file
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. * @copyright (C) 2018 Nuvoton Technology Corp. All rights reserved.
  8. ******************************************************************************/
  9. #ifndef __NU_CRYPTO_H__
  10. #define __NU_CRYPTO_H__
  11. #ifdef __cplusplus
  12. extern "C"
  13. {
  14. #endif
  15. /** @addtogroup Standard_Driver Standard Driver
  16. @{
  17. */
  18. /** @addtogroup Crypto_Driver Crypto Driver
  19. @{
  20. */
  21. /**
  22. @addtogroup CRPT Cryptographic Accelerator(CRPT)
  23. Memory Mapped Structure for Cryptographic Accelerator
  24. @{ */
  25. typedef struct
  26. {
  27. /**
  28. * @var CRPT_T::INTEN
  29. * Offset: 0x00 Crypto Interrupt Enable Control Register
  30. * ---------------------------------------------------------------------------------------------------
  31. * |Bits |Field |Descriptions
  32. * | :----: | :----: | :---- |
  33. * |[0] |AESIEN |AES Interrupt Enable Control
  34. * | | |0 = AES interrupt Disabled.
  35. * | | |1 = AES interrupt Enabled.
  36. * | | |In DMA mode, an interrupt will be triggered when amount of data set in AES_DMA_CNT is fed into the AES engine.
  37. * | | |In Non-DMA mode, an interrupt will be triggered when the AES engine finishes the operation.
  38. * |[1] |AESEIEN |AES Error Flag Enable Control
  39. * | | |0 = AES error interrupt flag Disabled.
  40. * | | |1 = AES error interrupt flag Enabled.
  41. * |[8] |TDESIEN |TDES/DES Interrupt Enable Control
  42. * | | |0 = TDES/DES interrupt Disabled.
  43. * | | |1 = TDES/DES interrupt Enabled.
  44. * | | |In DMA mode, an interrupt will be triggered when amount of data set in TDES_DMA_CNT is fed into the TDES engine.
  45. * | | |In Non-DMA mode, an interrupt will be triggered when the TDES engine finishes the operation.
  46. * |[9] |TDESEIEN |TDES/DES Error Flag Enable Control
  47. * | | |0 = TDES/DES error interrupt flag Disabled.
  48. * | | |1 = TDES/DES error interrupt flag Enabled.
  49. * |[16] |PRNGIEN |PRNG Interrupt Enable Control
  50. * | | |0 = PRNG interrupt Disabled.
  51. * | | |1 = PRNG interrupt Enabled.
  52. * |[22] |ECCIEN |ECC Interrupt Enable Control
  53. * | | |0 = ECC interrupt Disabled.
  54. * | | |1 = ECC interrupt Enabled.
  55. * | | |In DMA mode, an interrupt will be triggered when amount of data set in ECC_DMA_CNT is fed into the ECC engine.
  56. * | | |In Non-DMA mode, an interrupt will be triggered when the ECC engine finishes the operation.
  57. * |[23] |ECCEIEN |ECC Error Interrupt Enable Control
  58. * | | |0 = ECC error interrupt flag Disabled.
  59. * | | |1 = ECC error interrupt flag Enabled.
  60. * |[24] |HMACIEN |SHA/HMAC Interrupt Enable Control
  61. * | | |0 = SHA/HMAC interrupt Disabled.
  62. * | | |1 = SHA/HMAC interrupt Enabled.
  63. * | | |In DMA mode, an interrupt will be triggered when amount of data set in SHA _DMA_CNT is fed into the SHA/HMAC engine
  64. * | | |In Non-DMA mode, an interrupt will be triggered when the SHA/HMAC engine finishes the operation.
  65. * |[25] |HMACEIEN |SHA/HMAC Error Interrupt Enable Control
  66. * | | |0 = SHA/HMAC error interrupt flag Disabled.
  67. * | | |1 = SHA/HMAC error interrupt flag Enabled.
  68. * @var CRPT_T::INTSTS
  69. * Offset: 0x04 Crypto Interrupt Flag
  70. * ---------------------------------------------------------------------------------------------------
  71. * |Bits |Field |Descriptions
  72. * | :----: | :----: | :---- |
  73. * |[0] |AESIF |AES Finish Interrupt Flag
  74. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  75. * | | |0 = No AES interrupt.
  76. * | | |= AES encryption/decryption done interrupt.
  77. * |[1] |AESEIF |AES Error Flag
  78. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  79. * | | |0 = No AES error.
  80. * | | |1 = AES encryption/decryption done interrupt.
  81. * |[8] |TDESIF |TDES/DES Finish Interrupt Flag
  82. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  83. * | | |0 = No TDES/DES interrupt.
  84. * | | |1 = TDES/DES encryption/decryption done interrupt.
  85. * |[9] |TDESEIF |TDES/DES Error Flag
  86. * | | |This bit includes the operating and setting error
  87. * | | |The detailed flag is shown in the CRPT_TDES_STS register
  88. * | | |This includes operating and setting error.
  89. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  90. * | | |0 = No TDES/DES error.
  91. * | | |1 = TDES/DES encryption/decryption error interrupt.
  92. * |[16] |PRNGIF |PRNG Finish Interrupt Flag
  93. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  94. * | | |0 = No PRNG interrupt.
  95. * | | |1 = PRNG key generation done interrupt.
  96. * |[22] |ECCIF |ECC Finish Interrupt Flag
  97. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  98. * | | |0 = No ECC interrupt.
  99. * | | |1 = ECC operation done interrupt.
  100. * |[23] |ECCEIF |ECC Error Flag
  101. * | | |This register includes operating and setting error. The detail flag is shown in CRPT_ECC_STS register.
  102. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  103. * | | |0 = No ECC error.
  104. * | | |1 = ECC error interrupt.
  105. * |[24] |HMACIF |SHA/HMAC Finish Interrupt Flag
  106. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  107. * | | |0 = No SHA/HMAC interrupt.
  108. * | | |1 = SHA/HMAC operation done interrupt.
  109. * |[25] |HMACEIF |SHA/HMAC Error Flag
  110. * | | |This register includes operating and setting error. The detail flag is shown in CRPT_HMAC_STS register.
  111. * | | |This bit is cleared by writing 1, and it has no effect by writing 0.
  112. * | | |0 = No SHA/HMAC error.
  113. * | | |1 = SHA/HMAC error interrupt.
  114. * @var CRPT_T::PRNG_CTL
  115. * Offset: 0x08 PRNG Control Register
  116. * ---------------------------------------------------------------------------------------------------
  117. * |Bits |Field |Descriptions
  118. * | :----: | :----: | :---- |
  119. * |[0] |START |Start PRNG Engine
  120. * | | |0 = Stop PRNG engine.
  121. * | | |1 = Generate new key and store the new key to register CRPT_PRNG_KEYx , which will be cleared when the new key is generated.
  122. * |[1] |SEEDRLD |Reload New Seed for PRNG Engine
  123. * | | |0 = Generating key based on the current seed.
  124. * | | |1 = Reload new seed.
  125. * |[3:2] |KEYSZ |PRNG Generate Key Size
  126. * | | |00 = 64 bits.
  127. * | | |01 = 128 bits.
  128. * | | |10 = 192 bits.
  129. * | | |11 = 256 bits.
  130. * |[8] |BUSY |PRNG Busy (Read Only)
  131. * | | |0 = PRNG engine is idle.
  132. * | | |1 = Indicate that the PRNG engine is generating CRPT_PRNG_KEYx.
  133. * @var CRPT_T::PRNG_SEED
  134. * Offset: 0x0C Seed for PRNG
  135. * ---------------------------------------------------------------------------------------------------
  136. * |Bits |Field |Descriptions
  137. * | :----: | :----: | :---- |
  138. * |[31:0] |SEED |Seed for PRNG (Write Only)
  139. * | | |The bits store the seed for PRNG engine.
  140. * @var CRPT_T::PRNG_KEY[8]
  141. * Offset: 0x10 ~ 0x2C PRNG Generated Key0 ~ Key7
  142. * ---------------------------------------------------------------------------------------------------
  143. * |Bits |Field |Descriptions
  144. * | :----: | :----: | :---- |
  145. * |[31:0] |KEY |Store PRNG Generated Key (Read Only)
  146. * | | |The bits store the key that is generated by PRNG.
  147. * @var CRPT_T::AES_FDBCK[4]
  148. * Offset: 0x50 ~ 0x5C AES Engine Output Feedback Data after Cryptographic Operation
  149. * ---------------------------------------------------------------------------------------------------
  150. * |Bits |Field |Descriptions
  151. * | :----: | :----: | :---- |
  152. * |[31:0] |FDBCK |AES Feedback Information
  153. * | | |The feedback value is 128 bits in size.
  154. * | | |The AES engine uses the data from CRPT_AES_FDBCKx as the data inputted to CRPT_AESn_IVx for the next block in DMA cascade mode.
  155. * | | |The AES engine outputs feedback information for IV in the next block's operation
  156. * | | |Software can use this feedback information to implement more than four DMA channels
  157. * | | |Software can store that feedback value temporarily
  158. * | | |After switching back, fill the stored feedback value to this register in the same channel operation, and then continue the operation with the original setting.
  159. * @var CRPT_T::TDES_FDBCKH
  160. * Offset: 0x60 TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation
  161. * ---------------------------------------------------------------------------------------------------
  162. * |Bits |Field |Descriptions
  163. * | :----: | :----: | :---- |
  164. * |[31:0] |FDBCK |TDES/DES Feedback
  165. * | | |The feedback value is 64 bits in size.
  166. * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode
  167. * | | |The feedback register is for CBC, CFB, and OFB mode.
  168. * | | |TDES/DES engine outputs feedback information for IV in the next block's operation
  169. * | | |Software can use this feedback information to implement more than four DMA channels
  170. * | | |Software can store that feedback value temporarily
  171. * | | |After switching back, fill the stored feedback value to this register in the same channel operation
  172. * | | |Then can continue the operation with the original setting.
  173. * @var CRPT_T::TDES_FDBCKL
  174. * Offset: 0x64 TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation
  175. * ---------------------------------------------------------------------------------------------------
  176. * |Bits |Field |Descriptions
  177. * | :----: | :----: | :---- |
  178. * |[31:0] |FDBCK |TDES/DES Feedback
  179. * | | |The feedback value is 64 bits in size.
  180. * | | |The TDES/DES engine uses the data from {CRPT_TDES_FDBCKH, CRPT_TDES_FDBCKL} as the data inputted to {CRPT_TDESn_IVH, CRPT_TDESn_IVL} for the next block in DMA cascade mode
  181. * | | |The feedback register is for CBC, CFB, and OFB mode.
  182. * | | |TDES/DES engine outputs feedback information for IV in the next block's operation
  183. * | | |Software can use this feedback information to implement more than four DMA channels
  184. * | | |Software can store that feedback value temporarily
  185. * | | |After switching back, fill the stored feedback value to this register in the same channel operation
  186. * | | |Then can continue the operation with the original setting.
  187. * @var CRPT_T::AES_CTL
  188. * Offset: 0x100 AES Control Register
  189. * ---------------------------------------------------------------------------------------------------
  190. * |Bits |Field |Descriptions
  191. * | :----: | :----: | :---- |
  192. * |[0] |START |AES Engine Start
  193. * | | |0 = No effect.
  194. * | | |1 = Start AES engine. BUSY flag will be set.
  195. * | | |Note: This bit is always 0 when it's read back.
  196. * |[1] |STOP |AES Engine Stop
  197. * | | |0 = No effect.
  198. * | | |1 = Stop AES engine.
  199. * | | |Note: This bit is always 0 when it's read back.
  200. * |[3:2] |KEYSZ |AES Key Size
  201. * | | |This bit defines three different key size for AES operation.
  202. * | | |2'b00 = 128 bits key.
  203. * | | |2'b01 = 192 bits key.
  204. * | | |2'b10 = 256 bits key.
  205. * | | |2'b11 = Reserved.
  206. * | | |If the AES accelerator is operating and the corresponding flag BUSY is 1, updating this register has no effect.
  207. * |[5] |DMALAST |AES Last Block
  208. * | | |In DMA mode, this bit must be set as beginning the last DMA cascade round.
  209. * | | |In Non-DMA mode, this bit must be set when feeding in the last block of data in ECB, CBC, CTR, OFB, and CFB mode, and feeding in the (last-1) block of data at CBC-CS1, CBC-CS2, and CBC-CS3 mode.
  210. * | | |This bit is always 0 when it's read back. Must be written again once START is triggered.
  211. * |[6] |DMACSCAD |AES Engine DMA with Cascade Mode
  212. * | | |0 = DMA cascade function Disabled.
  213. * | | |1 = In DMA cascade mode, software can update DMA source address register, destination address register, and byte count register during a cascade operation, without finishing the accelerator operation.
  214. * |[7] |DMAEN |AES Engine DMA Enable Control
  215. * | | |0 = AES DMA engine Disabled.
  216. * | | |The AES engine operates in Non-DMA mode, and gets data from the port CRPT_AES_DATIN.
  217. * | | |1 = AES_DMA engine Enabled.
  218. * | | |The AES engine operates in DMA mode, and data movement from/to the engine is done by DMA logic.
  219. * |[15:8] |OPMODE |AES Engine Operation Modes
  220. * | | |0x00 = ECB (Electronic Codebook Mode) 0x01 = CBC (Cipher Block Chaining Mode).
  221. * | | |0x02 = CFB (Cipher Feedback Mode).
  222. * | | |0x03 = OFB (Output Feedback Mode).
  223. * | | |0x04 = CTR (Counter Mode).
  224. * | | |0x10 = CBC-CS1 (CBC Ciphertext-Stealing 1 Mode).
  225. * | | |0x11 = CBC-CS2 (CBC Ciphertext-Stealing 2 Mode).
  226. * | | |0x12 = CBC-CS3 (CBC Ciphertext-Stealing 3 Mode).
  227. * |[16] |ENCRPT |AES Encryption/Decryption
  228. * | | |0 = AES engine executes decryption operation.
  229. * | | |1 = AES engine executes encryption operation.
  230. * |[22] |OUTSWAP |AES Engine Output Data Swap
  231. * | | |0 = Keep the original order.
  232. * | | |1 = The order that CPU outputs data from the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}.
  233. * |[23] |INSWAP |AES Engine Input Data Swap
  234. * | | |0 = Keep the original order.
  235. * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}.
  236. * |[25:24] |CHANNEL |AES Engine Working Channel
  237. * | | |00 = Current control register setting is for channel 0.
  238. * | | |01 = Current control register setting is for channel 1.
  239. * | | |10 = Current control register setting is for channel 2.
  240. * | | |11 = Current control register setting is for channel 3.
  241. * |[30:26] |KEYUNPRT |Unprotect Key
  242. * | | |Writing 0 to CRPT_AES_CTL[31] and "10110" to CRPT_AES_CTL[30:26] is to unprotect the AES key.
  243. * | | |The KEYUNPRT can be read and written
  244. * | | |When it is written as the AES engine is operating, BUSY flag is 1, there would be no effect on KEYUNPRT.
  245. * |[31] |KEYPRT |Protect Key
  246. * | | |Read as a flag to reflect KEYPRT.
  247. * | | |0 = No effect.
  248. * | | |1 = Protect the content of the AES key from reading
  249. * | | |The return value for reading CRPT_AESn_KEYx is not the content of the registers CRPT_AESn_KEYx
  250. * | | |Once it is set, it can be cleared by asserting KEYUNPRT
  251. * | | |And the key content would be cleared as well.
  252. * @var CRPT_T::AES_STS
  253. * Offset: 0x104 AES Engine Flag
  254. * ---------------------------------------------------------------------------------------------------
  255. * |Bits |Field |Descriptions
  256. * | :----: | :----: | :---- |
  257. * |[0] |BUSY |AES Engine Busy
  258. * | | |0 = The AES engine is idle or finished.
  259. * | | |1 = The AES engine is under processing.
  260. * |[8] |INBUFEMPTY|AES Input Buffer Empty
  261. * | | |0 = There are some data in input buffer waiting for the AES engine to process.
  262. * | | |1 = AES input buffer is empty
  263. * | | |Software needs to feed data to the AES engine
  264. * | | |Otherwise, the AES engine will be pending to wait for input data.
  265. * |[9] |INBUFFULL |AES Input Buffer Full Flag
  266. * | | |0 = AES input buffer is not full. Software can feed the data into the AES engine.
  267. * | | |1 = AES input buffer is full
  268. * | | |Software cannot feed data to the AES engine
  269. * | | |Otherwise, the flag INBUFERR will be set to 1.
  270. * |[10] |INBUFERR |AES Input Buffer Error Flag
  271. * | | |0 = No error.
  272. * | | |1 = Error happens during feeding data to the AES engine.
  273. * |[12] |CNTERR |CRPT_AESn_CNT Setting Error
  274. * | | |0 = No error in CRPT_AESn_CNT setting.
  275. * | | |1 = CRPT_AESn_CNT is not a multiply of 16 in ECB, CBC, CFB, OFB, and CTR mode.
  276. * |[16] |OUTBUFEMPTY|AES Out Buffer Empty
  277. * | | |0 = AES output buffer is not empty. There are some valid data kept in output buffer.
  278. * | | |1 = AES output buffer is empty
  279. * | | |Software cannot get data from CRPT_AES_DATOUT
  280. * | | |Otherwise, the flag OUTBUFERR will be set to 1 since the output buffer is empty.
  281. * |[17] |OUTBUFFULL|AES Out Buffer Full Flag
  282. * | | |0 = AES output buffer is not full.
  283. * | | |1 = AES output buffer is full, and software needs to get data from CRPT_AES_DATOUT
  284. * | | |Otherwise, the AES engine will be pending since the output buffer is full.
  285. * |[18] |OUTBUFERR |AES Out Buffer Error Flag
  286. * | | |0 = No error.
  287. * | | |1 = Error happens during getting the result from AES engine.
  288. * |[20] |BUSERR |AES DMA Access Bus Error Flag
  289. * | | |0 = No error.
  290. * | | |1 = Bus error will stop DMA operation and AES engine.
  291. * @var CRPT_T::AES_DATIN
  292. * Offset: 0x108 AES Engine Data Input Port Register
  293. * ---------------------------------------------------------------------------------------------------
  294. * |Bits |Field |Descriptions
  295. * | :----: | :----: | :---- |
  296. * |[31:0] |DATIN |AES Engine Input Port
  297. * | | |CPU feeds data to AES engine through this port by checking CRPT_AES_STS. Feed data as INBUFFULL is 0.
  298. * @var CRPT_T::AES_DATOUT
  299. * Offset: 0x10C AES Engine Data Output Port Register
  300. * ---------------------------------------------------------------------------------------------------
  301. * |Bits |Field |Descriptions
  302. * | :----: | :----: | :---- |
  303. * |[31:0] |DATOUT |AES Engine Output Port
  304. * | | |CPU gets results from the AES engine through this port by checking CRPT_AES_STS
  305. * | | |Get data as OUTBUFEMPTY is 0.
  306. * @var CRPT_T::AES0_KEY[8]
  307. * Offset: 0x110 ~ 0x12C AES Key Word 0 ~ 7 Register for Channel 0
  308. * ---------------------------------------------------------------------------------------------------
  309. * |Bits |Field |Descriptions
  310. * | :----: | :----: | :---- |
  311. * |[31:0] |KEY |CRPT_AESn_KEYx
  312. * | | |The KEY keeps the security key for AES operation.
  313. * | | |n = 0, 1..3.
  314. * | | |x = 0, 1..7.
  315. * | | |The security key for AES accelerator can be 128, 192, or 256 bits and four, six, or eight 32-bit registers are to store each security key
  316. * | | |{CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 128-bit security key for AES operation
  317. * | | |{CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 192-bit security key for AES operation
  318. * | | |{CRPT_AESn_KEY7, CRPT_AESn_KEY6, CRPT_AESn_KEY5, CRPT_AESn_KEY4, CRPT_AESn_KEY3, CRPT_AESn_KEY2, CRPT_AESn_KEY1, CRPT_AESn_KEY0} stores the 256-bit security key for AES operation.
  319. * @var CRPT_T::AES0_IV[4]
  320. * Offset: 0x130 ~ 0x13C AES Initial Vector Word 0 ~ 3 Register for Channel 0
  321. * ---------------------------------------------------------------------------------------------------
  322. * |Bits |Field |Descriptions
  323. * | :----: | :----: | :---- |
  324. * |[31:0] |IV |AES Initial Vectors
  325. * | | |n = 0, 1..3.
  326. * | | |x = 0, 1..3.
  327. * | | |Four initial vectors (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) are for AES operating in CBC, CFB, and OFB mode
  328. * | | |Four registers (CRPT_AESn_IV0, CRPT_AESn_IV1, CRPT_AESn_IV2, and CRPT_AESn_IV3) act as Nonce counter when the AES engine is operating in CTR mode.
  329. * @var CRPT_T::AES0_SADDR
  330. * Offset: 0x140 AES DMA Source Address Register for Channel 0
  331. * ---------------------------------------------------------------------------------------------------
  332. * |Bits |Field |Descriptions
  333. * | :----: | :----: | :---- |
  334. * |[31:0] |SADDR |AES DMA Source Address
  335. * | | |The AES accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO
  336. * | | |The SADDR keeps the source address of the data buffer where the source text is stored
  337. * | | |Based on the source address, the AES accelerator can read the plain text from system memory and do AES operation
  338. * | | |The start of source address should be located at word boundary
  339. * | | |In other words, bit 1 and 0 of SADDR are ignored.
  340. * | | |SADDR can be read and written
  341. * | | |Writing to SADDR while the AES accelerator is operating doesn't affect the current AES operation
  342. * | | |But the value of SADDR will be updated later on
  343. * | | |Consequently, software can prepare the DMA source address for the next AES operation.
  344. * | | |In DMA mode, software can update the next CRPT_AESn_SADDR before triggering START.
  345. * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same.
  346. * @var CRPT_T::AES0_DADDR
  347. * Offset: 0x144 AES DMA Destination Address Register for Channel 0
  348. * ---------------------------------------------------------------------------------------------------
  349. * |Bits |Field |Descriptions
  350. * | :----: | :----: | :---- |
  351. * |[31:0] |DADDR |AES DMA Destination Address
  352. * | | |The AES accelerator supports DMA function to transfer the cipher text between system memory and embedded FIFO
  353. * | | |The DADDR keeps the destination address of the data buffer where the engine output's text will be stored
  354. * | | |Based on the destination address, the AES accelerator can write the cipher text back to system memory after the AES operation is finished
  355. * | | |The start of destination address should be located at word boundary
  356. * | | |In other words, bit 1 and 0 of DADDR are ignored.
  357. * | | |DADDR can be read and written
  358. * | | |Writing to DADDR while the AES accelerator is operating doesn't affect the current AES operation
  359. * | | |But the value of DADDR will be updated later on
  360. * | | |Consequently, software can prepare the destination address for the next AES operation.
  361. * | | |In DMA mode, software can update the next CRPT_AESn_DADDR before triggering START.
  362. * | | |The value of CRPT_AESn_SADDR and CRPT_AESn_DADDR can be the same.
  363. * @var CRPT_T::AES0_CNT
  364. * Offset: 0x148 AES Byte Count Register for Channel 0
  365. * ---------------------------------------------------------------------------------------------------
  366. * |Bits |Field |Descriptions
  367. * | :----: | :----: | :---- |
  368. * |[31:0] |CNT |AES Byte Count
  369. * | | |The CRPT_AESn_CNT keeps the byte count of source text that is for the AES engine operating in DMA mode
  370. * | | |The CRPT_AESn_CNT is 32-bit and the maximum of byte count is 4G bytes.
  371. * | | |CRPT_AESn_CNT can be read and written
  372. * | | |Writing to CRPT_AESn_CNT while the AES accelerator is operating doesn't affect the current AES operation
  373. * | | |But the value of CRPT_AESn_CNT will be updated later on
  374. * | | |Consequently, software can prepare the byte count of data for the next AES operation.
  375. * | | |According to CBC-CS1, CBC-CS2, and CBC-CS3 standard, the count of operation data must be at least one block
  376. * | | |Operations that are less than one block will output unexpected result.
  377. * | | |In Non-DMA ECB, CBC, CFB, OFB, and CTR mode, CRPT_AESn_CNT must be set as byte count for the last block of data before feeding in the last block of data
  378. * | | |In Non-DMA CBC-CS1, CBC-CS2, and CBC-CS3 mode, CRPT_AESn_CNT must be set as byte count for the last two blocks of data before feeding in the last two blocks of data.
  379. * @var CRPT_T::HMAC_CTL
  380. * Offset: 0x300 SHA/HMAC Control Register
  381. * ---------------------------------------------------------------------------------------------------
  382. * |Bits |Field |Descriptions
  383. * | :----: | :----: | :---- |
  384. * |[0] |START |SHA/HMAC Engine Start
  385. * | | |0 = No effect.
  386. * | | |1 = Start SHA/HMAC engine. BUSY flag will be set.
  387. * | | |This bit is always 0 when it's read back.
  388. * |[1] |STOP |SHA/HMAC Engine Stop
  389. * | | |0 = No effect.
  390. * | | |1 = Stop SHA/HMAC engine.
  391. * | | |This bit is always 0 when it's read back.
  392. * |[4] |HMACEN |HMAC_SHA Engine Operating Mode
  393. * | | |0 = execute SHA function.
  394. * | | |1 = execute HMAC function.
  395. * |[5] |DMALAST |SHA/HMAC Last Block
  396. * | | |This bit must be set as feeding in last byte of data.
  397. * |[7] |DMAEN |SHA/HMAC Engine DMA Enable Control
  398. * | | |0 = SHA/HMAC DMA engine Disabled.
  399. * | | |SHA/HMAC engine operates in Non-DMA mode, and gets data from the port CRPT_HMAC_DATIN.
  400. * | | |1 = SHA/HMAC DMA engine Enabled.
  401. * | | |SHA/HMAC engine operates in DMA mode, and data movement from/to the engine is done by DMA logic.
  402. * |[10:8] |OPMODE |SHA/HMAC Engine Operation Modes
  403. * | | |0x0xx: SHA160
  404. * | | |0x100: SHA256
  405. * | | |0x101: SHA224
  406. * | | |0x110: SHA512
  407. * | | |0x111: SHA384
  408. * | | |These bits can be read and written. But writing to them wouldn't take effect as BUSY is 1.
  409. * |[22] |OUTSWAP |SHA/HMAC Engine Output Data Swap
  410. * | | |0 = Keep the original order.
  411. * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}.
  412. * |[23] |INSWAP |SHA/HMAC Engine Input Data Swap
  413. * | | |0 = Keep the original order.
  414. * | | |1 = The order that CPU feeds data to the accelerator will be changed from {byte3, byte2, byte1, byte0} to {byte0, byte1, byte2, byte3}.
  415. * @var CRPT_T::HMAC_STS
  416. * Offset: 0x304 SHA/HMAC Status Flag
  417. * ---------------------------------------------------------------------------------------------------
  418. * |Bits |Field |Descriptions
  419. * | :----: | :----: | :---- |
  420. * |[0] |BUSY |SHA/HMAC Engine Busy
  421. * | | |0 = SHA/HMAC engine is idle or finished.
  422. * | | |1 = SHA/HMAC engine is busy.
  423. * |[1] |DMABUSY |SHA/HMAC Engine DMA Busy Flag
  424. * | | |0 = SHA/HMAC DMA engine is idle or finished.
  425. * | | |1 = SHA/HMAC DMA engine is busy.
  426. * |[8] |DMAERR |SHA/HMAC Engine DMA Error Flag
  427. * | | |0 = Show the SHA/HMAC engine access normal.
  428. * | | |1 = Show the SHA/HMAC engine access error.
  429. * |[16] |DATINREQ |SHA/HMAC Non-DMA Mode Data Input Request
  430. * | | |0 = No effect.
  431. * | | |1 = Request SHA/HMAC Non-DMA mode data input.
  432. * @var CRPT_T::HMAC_DGST[16]
  433. * Offset: 0x308 ~ 0x344 SHA/HMAC Digest Message 0 ~ 15
  434. * ---------------------------------------------------------------------------------------------------
  435. * |Bits |Field |Descriptions
  436. * | :----: | :----: | :---- |
  437. * |[31:0] |DGST |SHA/HMAC Digest Message Output Register
  438. * | | |For SHA-160, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST4.
  439. * | | |For SHA-224, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST6.
  440. * | | |For SHA-256, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST7.
  441. * | | |For SHA-384, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST11.
  442. * | | |For SHA-512, the digest is stored in CRPT_HMAC_DGST0 ~ CRPT_HMAC_DGST15.
  443. * @var CRPT_T::HMAC_KEYCNT
  444. * Offset: 0x348 SHA/HMAC Key Byte Count Register
  445. * ---------------------------------------------------------------------------------------------------
  446. * |Bits |Field |Descriptions
  447. * | :----: | :----: | :---- |
  448. * |[31:0] |KEYCNT |SHA/HMAC Key Byte Count
  449. * | | |The CRPT_HMAC_KEYCNT keeps the byte count of key that SHA/HMAC engine operates
  450. * | | |The register is 32-bit and the maximum byte count is 4G bytes
  451. * | | |It can be read and written.
  452. * | | |Writing to the register CRPT_HMAC_KEYCNT as the SHA/HMAC accelerator operating doesn't affect the current SHA/HMAC operation
  453. * | | |But the value of CRPT_SHA _KEYCNT will be updated later on
  454. * | | |Consequently, software can prepare the key count for the next SHA/HMAC operation.
  455. * @var CRPT_T::HMAC_SADDR
  456. * Offset: 0x34C SHA/HMAC DMA Source Address Register
  457. * ---------------------------------------------------------------------------------------------------
  458. * |Bits |Field |Descriptions
  459. * | :----: | :----: | :---- |
  460. * |[31:0] |SADDR |SHA/HMAC DMA Source Address
  461. * | | |The SHA/HMAC accelerator supports DMA function to transfer the plain text between system memory and embedded FIFO
  462. * | | |The CRPT_HMAC_SADDR keeps the source address of the data buffer where the source text is stored
  463. * | | |Based on the source address, the SHA/HMAC accelerator can read the plain text from system memory and do SHA/HMAC operation
  464. * | | |The start of source address should be located at word boundary
  465. * | | |In other words, bit 1 and 0 of CRPT_HMAC_SADDR are ignored.
  466. * | | |CRPT_HMAC_SADDR can be read and written
  467. * | | |Writing to CRPT_HMAC_SADDR while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation
  468. * | | |But the value of CRPT_HMAC_SADDR will be updated later on
  469. * | | |Consequently, software can prepare the DMA source address for the next SHA/HMAC operation.
  470. * | | |In DMA mode, software can update the next CRPT_HMAC_SADDR before triggering START.
  471. * | | |CRPT_HMAC_SADDR and CRPT_HMAC_DADDR can be the same in the value.
  472. * @var CRPT_T::HMAC_DMACNT
  473. * Offset: 0x350 SHA/HMAC Byte Count Register
  474. * ---------------------------------------------------------------------------------------------------
  475. * |Bits |Field |Descriptions
  476. * | :----: | :----: | :---- |
  477. * |[31:0] |DMACNT |SHA/HMAC Operation Byte Count
  478. * | | |The CRPT_HMAC_DMACNT keeps the byte count of source text that is for the SHA/HMAC engine operating in DMA mode
  479. * | | |The CRPT_HMAC_DMACNT is 32-bit and the maximum of byte count is 4G bytes.
  480. * | | |CRPT_HMAC_DMACNT can be read and written
  481. * | | |Writing to CRPT_HMAC_DMACNT while the SHA/HMAC accelerator is operating doesn't affect the current SHA/HMAC operation
  482. * | | |But the value of CRPT_HMAC_DMACNT will be updated later on
  483. * | | |Consequently, software can prepare the byte count of data for the next SHA/HMAC operation.
  484. * | | |In Non-DMA mode, CRPT_HMAC_DMACNT must be set as the byte count of the last block before feeding in the last block of data.
  485. * @var CRPT_T::HMAC_DATIN
  486. * Offset: 0x354 SHA/HMAC Engine Non-DMA Mode Data Input Port Register
  487. * ---------------------------------------------------------------------------------------------------
  488. * |Bits |Field |Descriptions
  489. * | :----: | :----: | :---- |
  490. * |[31:0] |DATIN |SHA/HMAC Engine Input Port
  491. * | | |CPU feeds data to SHA/HMAC engine through this port by checking CRPT_HMAC_STS
  492. * | | |Feed data as DATINREQ is 1.
  493. * @var CRPT_T::ECC_CTL
  494. * Offset: 0x800 ECC Control Register
  495. * ---------------------------------------------------------------------------------------------------
  496. * |Bits |Field |Descriptions
  497. * | :----: | :----: | :---- |
  498. * |[0] |START |ECC Accelerator Start
  499. * | | |0 = No effect.
  500. * | | |1 = Start ECC accelerator. BUSY flag will be set.
  501. * | | |This bit is always 0 when it's read back.
  502. * | | |ECC accelerator will ignore this START signal when BUSY flag is 1.
  503. * |[1] |STOP |ECC Accelerator Stop
  504. * | | |0 = No effect.
  505. * | | |1 = Abort ECC accelerator and make it into idle state.
  506. * | | |This bit is always 0 when it's read back.
  507. * | | |Remember to clear ECC interrupt flag after stopping ECC accelerator.
  508. * |[7] |DMAEN |ECC Accelerator DMA Enable Control
  509. * | | |0 = ECC DMA engine Disabled.
  510. * | | |1 = ECC DMA engine Enabled.
  511. * | | |Only when START and DMAEN are 1, ECC DMA engine will be active
  512. * |[8] |FSEL |Field Selection
  513. * | | |0 = Binary Field (GF(2^m)).
  514. * | | |1 = Prime Field (GF(p)).
  515. * |[10:9] |ECCOP |Point Operation for BF and PF
  516. * | | |00 = Point multiplication :.
  517. * | | |(POINTX1, POINTY1) = SCALARK * (POINTX1, POINTY1).
  518. * | | |01 = Modulus operation : choose by MODOP (CRPT_ECC_CTL[12:11]).
  519. * | | |10 = Point addition :.
  520. * | | |(POINTX1, POINTY1) = (POINTX1, POINTY1) +.
  521. * | | |(POINTX2, POINTY2)
  522. * | | |11 = Point doubling :.
  523. * | | |(POINTX1, POINTY1) = 2 * (POINTX1, POINTY1).
  524. * | | |Besides above three input data, point operations still need the parameters of elliptic curve (CURVEA, CURVEB, CURVEN and CURVEM) as shown in Figure 6.27-11
  525. * |[12:11] |MODOP |Modulus Operation for PF
  526. * | | |00 = Division :.
  527. * | | |POINTX1 = (POINTY1 / POINTX1) % CURVEN.
  528. * | | |01 = Multiplication :.
  529. * | | |POINTX1 = (POINTX1 * POINTY1) % CURVEN.
  530. * | | |10 = Addition :.
  531. * | | |POINTX1 = (POINTX1 + POINTY1) % CURVEN.
  532. * | | |11 = Subtraction :.
  533. * | | |POINTX1 = (POINTX1 - POINTY1) % CURVEN.
  534. * | | |MODOP is active only when ECCOP = 01.
  535. * |[16] |LDP1 |The Control Signal of Register for the X and Y Coordinate of the First Point (POINTX1, POINTY1)
  536. * | | |0 = The register for POINTX1 and POINTY1 is not modified by DMA or user.
  537. * | | |1 = The register for POINTX1 and POINTY1 is modified by DMA or user.
  538. * |[17] |LDP2 |The Control Signal of Register for the X and Y Coordinate of the Second Point (POINTX2, POINTY2)
  539. * | | |0 = The register for POINTX2 and POINTY2 is not modified by DMA or user.
  540. * | | |1 = The register for POINTX2 and POINTY2 is modified by DMA or user.
  541. * |[18] |LDA |The Control Signal of Register for the Parameter CURVEA of Elliptic Curve
  542. * | | |0 = The register for CURVEA is not modified by DMA or user.
  543. * | | |1 = The register for CURVEA is modified by DMA or user.
  544. * |[19] |LDB |The Control Signal of Register for the Parameter CURVEB of Elliptic Curve
  545. * | | |0 = The register for CURVEB is not modified by DMA or user.
  546. * | | |1 = The register for CURVEB is modified by DMA or user.
  547. * |[20] |LDN |The Control Signal of Register for the Parameter CURVEN of Elliptic Curve
  548. * | | |0 = The register for CURVEN is not modified by DMA or user.
  549. * | | |1 = The register for CURVEN is modified by DMA or user.
  550. * |[21] |LDK |The Control Signal of Register for SCALARK
  551. * | | |0 = The register for SCALARK is not modified by DMA or user.
  552. * | | |1 = The register for SCALARK is modified by DMA or user.
  553. * |[31:22] |CURVEM |The key length of elliptic curve.
  554. * @var CRPT_T::ECC_STS
  555. * Offset: 0x804 ECC Status Register
  556. * ---------------------------------------------------------------------------------------------------
  557. * |Bits |Field |Descriptions
  558. * | :----: | :----: | :---- |
  559. * |[0] |BUSY |ECC Accelerator Busy Flag
  560. * | | |0 = The ECC accelerator is idle or finished.
  561. * | | |1 = The ECC accelerator is under processing and protects all registers.
  562. * | | |Remember to clear ECC interrupt flag after ECC accelerator finished
  563. * |[1] |DMABUSY |ECC DMA Busy Flag
  564. * | | |0 = ECC DMA is idle or finished.
  565. * | | |1 = ECC DMA is busy.
  566. * |[16] |BUSERR |ECC DMA Access Bus Error Flag
  567. * | | |0 = No error.
  568. * | | |1 = Bus error will stop DMA operation and ECC accelerator.
  569. * @var CRPT_T::ECC_X1[18]
  570. * Offset: 0x808 ~ 0x84C ECC The X-coordinate word 0 ~ 17 of the first point
  571. * ---------------------------------------------------------------------------------------------------
  572. * |Bits |Field |Descriptions
  573. * | :----: | :----: | :---- |
  574. * |[31:0] |POINTX1 |ECC the x-coordinate Value of the First Point (POINTX1)
  575. * | | |For B-163 or K-163, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05
  576. * | | |For B-233 or K-233, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07
  577. * | | |For B-283 or K-283, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_08
  578. * | | |For B-409 or K-409, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_12
  579. * | | |For B-571 or K-571, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_17
  580. * | | |For P-192, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_05
  581. * | | |For P-224, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_06
  582. * | | |For P-256, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_07
  583. * | | |For P-384, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_11
  584. * | | |For P-521, POINTX1 is stored in CRPT_ECC_X1_00~CRPT_ECC_X1_16
  585. * @var CRPT_T::ECC_Y1[18]
  586. * Offset: 0x850 ~ 0x894 ECC The Y-coordinate word 0 ~ 17 of the first point
  587. * ---------------------------------------------------------------------------------------------------
  588. * |Bits |Field |Descriptions
  589. * | :----: | :----: | :---- |
  590. * |[31:0] |POINTY1 |ECC the Y-coordinate Value of the First Point (POINTY1)
  591. * | | |For B-163 or K-163, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05
  592. * | | |For B-233 or K-233, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07
  593. * | | |For B-283 or K-283, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_08
  594. * | | |For B-409 or K-409, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_12
  595. * | | |For B-571 or K-571, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_17
  596. * | | |For P-192, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_05
  597. * | | |For P-224, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_06
  598. * | | |For P-256, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_07
  599. * | | |For P-384, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_11
  600. * | | |For P-521, POINTY1 is stored in CRPT_ECC_Y1_00~CRPT_ECC_Y1_16
  601. * @var CRPT_T::ECC_X2[18]
  602. * Offset: 0x898 ~ 0x8DC ECC The X-coordinate word 0 ~ 17 of the second point
  603. * ---------------------------------------------------------------------------------------------------
  604. * |Bits |Field |Descriptions
  605. * | :----: | :----: | :---- |
  606. * |[31:0] |POINTX2 |ECC the x-coordinate Value of the Second Point (POINTX2)
  607. * | | |For B-163 or K-163, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05
  608. * | | |For B-233 or K-233, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07
  609. * | | |For B-283 or K-283, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_08
  610. * | | |For B-409 or K-409, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_12
  611. * | | |For B-571 or K-571, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_17
  612. * | | |For P-192, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_05
  613. * | | |For P-224, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_06
  614. * | | |For P-256, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_07
  615. * | | |For P-384, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_11
  616. * | | |For P-521, POINTX2 is stored in CRPT_ECC_X2_00~CRPT_ECC_X2_16
  617. * @var CRPT_T::ECC_Y2[18]
  618. * Offset: 0x8E0 ~ 0x924 ECC The Y-coordinate word 0 ~ 17 of the second point
  619. * ---------------------------------------------------------------------------------------------------
  620. * |Bits |Field |Descriptions
  621. * | :----: | :----: | :---- |
  622. * |[31:0] |POINTY2 |ECC the Y-coordinate Value of the Second Point (POINTY2)
  623. * | | |For B-163 or K-163, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05
  624. * | | |For B-233 or K-233, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07
  625. * | | |For B-283 or K-283, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_08
  626. * | | |For B-409 or K-409, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_12
  627. * | | |For B-571 or K-571, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_17
  628. * | | |For P-192, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_05
  629. * | | |For P-224, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_06
  630. * | | |For P-256, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_07
  631. * | | |For P-384, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_11
  632. * | | |For P-521, POINTY2 is stored in CRPT_ECC_Y2_00~CRPT_ECC_Y2_16
  633. * @var CRPT_T::ECC_A[18]
  634. * Offset: 0x928 ~ 0x96C ECC The parameter CURVEA word 0 ~ 17 of elliptic curve
  635. * ---------------------------------------------------------------------------------------------------
  636. * |Bits |Field |Descriptions
  637. * | :----: | :----: | :---- |
  638. * |[31:0] |CURVEA |ECC the Parameter CURVEA Value of Elliptic Curve (CURVEA)
  639. * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m).
  640. * | | |For B-163 or K-163, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05
  641. * | | |For B-233 or K-233, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07
  642. * | | |For B-283 or K-283, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_08
  643. * | | |For B-409 or K-409, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_12
  644. * | | |For B-571 or K-571, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_17
  645. * | | |For P-192, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_05
  646. * | | |For P-224, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_06
  647. * | | |For P-256, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_07
  648. * | | |For P-384, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_11
  649. * | | |For P-521, CURVEA is stored in CRPT_ECC_A_00~CRPT_ECC_A_16
  650. * @var CRPT_T::ECC_B[18]
  651. * Offset: 0x970 ~ 0x9B4 ECC The parameter CURVEB word 0 ~ 17 of elliptic curve
  652. * ---------------------------------------------------------------------------------------------------
  653. * |Bits |Field |Descriptions
  654. * | :----: | :----: | :---- |
  655. * |[31:0] |CURVEB |ECC the Parameter CURVEB Value of Elliptic Curve (CURVEA)
  656. * | | |The formula of elliptic curve is y2=x3+CURVEA*x+CURVEB in GF(p) and y2+x*y=x3+CURVEA*x2+CURVEB in GF(2^m).
  657. * | | |For B-163 or K-163, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05
  658. * | | |For B-233 or K-233, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07
  659. * | | |For B-283 or K-283, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_08
  660. * | | |For B-409 or K-409, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_12
  661. * | | |For B-521 or K-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_17
  662. * | | |For P-192, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_05
  663. * | | |For P-224, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_06
  664. * | | |For P-256, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_07
  665. * | | |For P-384, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_11
  666. * | | |For P-521, CURVEB is stored in CRPT_ECC_B_00~CRPT_ECC_B_16
  667. * @var CRPT_T::ECC_N[18]
  668. * Offset: 0x9B8 ~ 0x9FC ECC The parameter CURVEN word 0 ~ 17 of elliptic curve
  669. * ---------------------------------------------------------------------------------------------------
  670. * |Bits |Field |Descriptions
  671. * | :----: | :----: | :---- |
  672. * |[31:0] |CURVEN |ECC the Parameter CURVEN Value of Elliptic Curve (CURVEN)
  673. * | | |In GF(p), CURVEN is the prime p.
  674. * | | |In GF(2^m), CURVEN is the irreducible polynomial.
  675. * | | |For B-163 or K-163, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05
  676. * | | |For B-233 or K-233, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07
  677. * | | |For B-283 or K-283, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_08
  678. * | | |For B-409 or K-409, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_12
  679. * | | |For B-571 or K-571, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_17
  680. * | | |For P-192, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_05
  681. * | | |For P-224, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_06
  682. * | | |For P-256, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_07
  683. * | | |For P-384, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_11
  684. * | | |For P-521, CURVEN is stored in CRPT_ECC_N_00~CRPT_ECC_N_16
  685. * @var CRPT_T::ECC_K[18]
  686. * Offset: 0xA00 ~ 0xA44 ECC The scalar SCALARK word0 of point multiplication
  687. * ---------------------------------------------------------------------------------------------------
  688. * |Bits |Field |Descriptions
  689. * | :----: | :----: | :---- |
  690. * |[31:0] |SCALARK |ECC the Scalar SCALARK Value of Point Multiplication(SCALARK)
  691. * | | |Because the SCALARK usually stores the private key, ECC accelerator do not allow to read the register SCALARK.
  692. * | | |For B-163 or K-163, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05
  693. * | | |For B-233 or K-233, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07
  694. * | | |For B-283 or K-283, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_08
  695. * | | |For B-409 or K-409, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_12
  696. * | | |For B-571 or K-571, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_17
  697. * | | |For P-192, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_05
  698. * | | |For P-224, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_06
  699. * | | |For P-256, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_07
  700. * | | |For P-384, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_11
  701. * | | |For P-521, SCALARK is stored in CRPT_ECC_K_00~CRPT_ECC_K_16
  702. * @var CRPT_T::ECC_SADDR
  703. * Offset: 0xA48 ECC DMA Source Address Register
  704. * ---------------------------------------------------------------------------------------------------
  705. * |Bits |Field |Descriptions
  706. * | :----: | :----: | :---- |
  707. * |[31:0] |SADDR |ECC DMA Source Address
  708. * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between
  709. * | | |SRAM memory space and ECC accelerator. The SADDR keeps the source address of the data
  710. * | | |buffer where the source text is stored. Based on the source address, the ECC accelerator
  711. * | | |can read the DATA and PARAMETER from SRAM memory space and do ECC operation. The start
  712. * | | |of source address should be located at word boundary. That is, bit 1 and 0 of SADDR are
  713. * | | |ignored. SADDR can be read and written. In DMA mode, software must update the CRPT_ECC_SADDR
  714. * | | |before triggering START.
  715. * @var CRPT_T::ECC_DADDR
  716. * Offset: 0xA4C ECC DMA Destination Address Register
  717. * ---------------------------------------------------------------------------------------------------
  718. * |Bits |Field |Descriptions
  719. * | :----: | :----: | :---- |
  720. * |[31:0] |DADDR |ECC DMA Destination Address
  721. * | | |The ECC accelerator supports DMA function to transfer the DATA and PARAMETER between system memory and ECC accelerator
  722. * | | |The DADDR keeps the destination address of the data buffer where output data of ECC engine will be stored
  723. * | | |Based on the destination address, the ECC accelerator can write the result data back to system memory after the ECC operation is finished
  724. * | | |The start of destination address should be located at word boundary
  725. * | | |That is, bit 1 and 0 of DADDR are ignored
  726. * | | |DADDR can be read and written
  727. * | | |In DMA mode, software must update the CRPT_ECC_DADDR before triggering START
  728. * @var CRPT_T::ECC_STARTREG
  729. * Offset: 0xA50 ECC Starting Address of Updated Registers
  730. * ---------------------------------------------------------------------------------------------------
  731. * |Bits |Field |Descriptions
  732. * | :----: | :----: | :---- |
  733. * |[31:0] |STARTREG |ECC Starting Address of Updated Registers
  734. * | | |The address of the updated registers that DMA feeds the first data or parameter to ECC engine
  735. * | | |When ECC engine is active, ECC accelerator does not allow users to modify STARTREG
  736. * | | |For example, we want to updated input data from register CRPT_ECC POINTX1
  737. * | | |Thus, the value of STARTREG is 0x808.
  738. * @var CRPT_T::ECC_WORDCNT
  739. * Offset: 0xA54 ECC DMA Word Count
  740. * ---------------------------------------------------------------------------------------------------
  741. * |Bits |Field |Descriptions
  742. * | :----: | :----: | :---- |
  743. * |[31:0] |WORDCNT |ECC DMA Word Count
  744. * | | |The CRPT_ECC_WORDCNT keeps the word count of source data that is for the required input data of ECC accelerator with various operations in DMA mode
  745. * | | |Although CRPT_ECC_WORDCNT is 32-bit, the maximum of word count in ECC accelerator is 144 words
  746. * | | |CRPT_ECC_WORDCNT can be read and written
  747. */
  748. __IO uint32_t INTEN; /*!< [0x0000] Crypto Interrupt Enable Control Register */
  749. __IO uint32_t INTSTS; /*!< [0x0004] Crypto Interrupt Flag */
  750. __IO uint32_t PRNG_CTL; /*!< [0x0008] PRNG Control Register */
  751. __O uint32_t PRNG_SEED; /*!< [0x000c] Seed for PRNG */
  752. __I uint32_t PRNG_KEY[8]; /*!< [0x0010] ~ [0x002c] PRNG Generated Key0 ~ Key7 */
  753. /// @cond HIDDEN_SYMBOLS
  754. __I uint32_t RESERVE0[8];
  755. /// @endcond //HIDDEN_SYMBOLS
  756. __I uint32_t AES_FDBCK[4]; /*!< [0x0050] ~ [0x005c] AES Engine Output Feedback Data after Cryptographic Operation */
  757. __I uint32_t TDES_FDBCKH; /*!< [0x0060] TDES/DES Engine Output Feedback High Word Data after Cryptographic Operation */
  758. __I uint32_t TDES_FDBCKL; /*!< [0x0064] TDES/DES Engine Output Feedback Low Word Data after Cryptographic Operation */
  759. /// @cond HIDDEN_SYMBOLS
  760. __I uint32_t RESERVE1[38];
  761. /// @endcond //HIDDEN_SYMBOLS
  762. __IO uint32_t AES_CTL; /*!< [0x0100] AES Control Register */
  763. __I uint32_t AES_STS; /*!< [0x0104] AES Engine Flag */
  764. __IO uint32_t AES_DATIN; /*!< [0x0108] AES Engine Data Input Port Register */
  765. __I uint32_t AES_DATOUT; /*!< [0x010c] AES Engine Data Output Port Register */
  766. __IO uint32_t AES0_KEY[8]; /*!< [0x0110] ~ [0x012c] AES Key Word 0~7 Register for Channel 0 */
  767. __IO uint32_t AES0_IV[4]; /*!< [0x0130] ~ [0x013c] AES Initial Vector Word 0 ~ 3 Register for Channel 0 */
  768. __IO uint32_t AES0_SADDR; /*!< [0x0140] AES DMA Source Address Register for Channel 0 */
  769. __IO uint32_t AES0_DADDR; /*!< [0x0144] AES DMA Destination Address Register for Channel 0 */
  770. __IO uint32_t AES0_CNT; /*!< [0x0148] AES Byte Count Register for Channel 0 */
  771. /// @cond HIDDEN_SYMBOLS
  772. __I uint32_t RESERVE2[109];
  773. /// @endcond //HIDDEN_SYMBOLS
  774. __IO uint32_t HMAC_CTL; /*!< [0x0300] SHA/HMAC Control Register */
  775. __I uint32_t HMAC_STS; /*!< [0x0304] SHA/HMAC Status Flag */
  776. __I uint32_t HMAC_DGST[16]; /*!< [0x0308] ~ [0x0344] SHA/HMAC Digest Message 0~15 */
  777. __IO uint32_t HMAC_KEYCNT; /*!< [0x0348] SHA/HMAC Key Byte Count Register */
  778. __IO uint32_t HMAC_SADDR; /*!< [0x034c] SHA/HMAC DMA Source Address Register */
  779. __IO uint32_t HMAC_DMACNT; /*!< [0x0350] SHA/HMAC Byte Count Register */
  780. __IO uint32_t HMAC_DATIN; /*!< [0x0354] SHA/HMAC Engine Non-DMA Mode Data Input Port Register */
  781. /// @cond HIDDEN_SYMBOLS
  782. __I uint32_t RESERVE3[298];
  783. /// @endcond //HIDDEN_SYMBOLS
  784. __IO uint32_t ECC_CTL; /*!< [0x0800] ECC Control Register */
  785. __I uint32_t ECC_STS; /*!< [0x0804] ECC Status Register */
  786. __IO uint32_t ECC_X1[18]; /*!< [0x0808] ~ [0x084c] ECC The X-coordinate word 0~17 of the first point */
  787. __IO uint32_t ECC_Y1[18]; /*!< [0x0850] ~ [0x0894] ECC The Y-coordinate word 0~17 of the first point */
  788. __IO uint32_t ECC_X2[18]; /*!< [0x0898] ~ [0x08dc] ECC The X-coordinate word 0~17 of the second point */
  789. __IO uint32_t ECC_Y2[18]; /*!< [0x08e0] ~ [0x0924] ECC The Y-coordinate word 0~17 of the second point */
  790. __IO uint32_t ECC_A[18]; /*!< [0x0928] ~ [0x096c] ECC The parameter CURVEA word 0~17 of elliptic curve */
  791. __IO uint32_t ECC_B[18]; /*!< [0x0970] ~ [0x09b4] ECC The parameter CURVEB word 0~17 of elliptic curve */
  792. __IO uint32_t ECC_N[18]; /*!< [0x09b8] ~ [0x09fc] ECC The parameter CURVEN word 0~17 of elliptic curve */
  793. __O uint32_t ECC_K[18]; /*!< [0x0a00] ~ [0x0a44] ECC The scalar SCALARK word 0~17 of point multiplication */
  794. __IO uint32_t ECC_SADDR; /*!< [0x0a48] ECC DMA Source Address Register */
  795. __IO uint32_t ECC_DADDR; /*!< [0x0a4c] ECC DMA Destination Address Register */
  796. __IO uint32_t ECC_STARTREG; /*!< [0x0a50] ECC Starting Address of Updated Registers */
  797. __IO uint32_t ECC_WORDCNT; /*!< [0x0a54] ECC DMA Word Count */
  798. /// @cond HIDDEN_SYMBOLS
  799. uint32_t RESERVE4[358];
  800. /// @endcond //HIDDEN_SYMBOLS
  801. __IO uint32_t ECC_FSM_DBG; /* Offset 0xFF0: ECC FSM Debug Register */
  802. /// @cond HIDDEN_SYMBOLS
  803. uint32_t RESERVE5[3];
  804. /// @endcond //HIDDEN_SYMBOLS
  805. __IO uint32_t RSA_CTL; /* Offset 0x1000: RSA Control Register */
  806. __IO uint32_t RSA_STS; /* Offset 0x1004: RSA Status Register */
  807. __IO uint32_t RSA_M[128]; /* Offset 0x1008: RSA the base of exponentiation words */
  808. __IO uint32_t RSA_E[128]; /* Offset 0x1208: RSA the exponent of exponentiation words */
  809. __IO uint32_t RSA_N[128]; /* Offset 0x1408: RSA the base of modulus operation word */
  810. __IO uint32_t RSA_C[128]; /* Offset 0x1608: RSA the constant value of Montgomery domain words */
  811. __IO uint32_t RSA_SADDR; /* Offset 0x1808: RSA DMA Source Address Register */
  812. __IO uint32_t RSA_DADDR; /* Offset 0x180C: RSA DMA Destination Address Register */
  813. __IO uint32_t RSA_STARTREG; /* Offset 0x1810: RSA Starting Address of Updated Registers */
  814. __IO uint32_t RSA_WORDCNT; /* Offset 0x1814: RSA DMA Word Count */
  815. } CRPT_T;
  816. #define CRPT ((CRPT_T *)0xB001C000)
  817. /**
  818. @addtogroup CRPT_CONST CRPT Bit Field Definition
  819. Constant Definitions for CRPT Controller
  820. @{ */
  821. #define CRPT_INTEN_AESIEN_Pos (0) /*!< CRPT_T::INTEN: AESIEN Position */
  822. #define CRPT_INTEN_AESIEN_Msk (0x1ul << CRPT_INTEN_AESIEN_Pos) /*!< CRPT_T::INTEN: AESIEN Mask */
  823. #define CRPT_INTEN_AESEIEN_Pos (1) /*!< CRPT_T::INTEN: AESEIEN Position */
  824. #define CRPT_INTEN_AESEIEN_Msk (0x1ul << CRPT_INTEN_AESEIEN_Pos) /*!< CRPT_T::INTEN: AESEIEN Mask */
  825. #define CRPT_INTEN_TDESIEN_Pos (8) /*!< CRPT_T::INTEN: TDESIEN Position */
  826. #define CRPT_INTEN_TDESIEN_Msk (0x1ul << CRPT_INTEN_TDESIEN_Pos) /*!< CRPT_T::INTEN: TDESIEN Mask */
  827. #define CRPT_INTEN_TDESEIEN_Pos (9) /*!< CRPT_T::INTEN: TDESEIEN Position */
  828. #define CRPT_INTEN_TDESEIEN_Msk (0x1ul << CRPT_INTEN_TDESEIEN_Pos) /*!< CRPT_T::INTEN: TDESEIEN Mask */
  829. #define CRPT_INTEN_PRNGIEN_Pos (16) /*!< CRPT_T::INTEN: PRNGIEN Position */
  830. #define CRPT_INTEN_PRNGIEN_Msk (0x1ul << CRPT_INTEN_PRNGIEN_Pos) /*!< CRPT_T::INTEN: PRNGIEN Mask */
  831. #define CRPT_INTEN_ECCIEN_Pos (22) /*!< CRPT_T::INTEN: ECCIEN Position */
  832. #define CRPT_INTEN_ECCIEN_Msk (0x1ul << CRPT_INTEN_ECCIEN_Pos) /*!< CRPT_T::INTEN: ECCIEN Mask */
  833. #define CRPT_INTEN_ECCEIEN_Pos (23) /*!< CRPT_T::INTEN: ECCEIEN Position */
  834. #define CRPT_INTEN_ECCEIEN_Msk (0x1ul << CRPT_INTEN_ECCEIEN_Pos) /*!< CRPT_T::INTEN: ECCEIEN Mask */
  835. #define CRPT_INTEN_HMACIEN_Pos (24) /*!< CRPT_T::INTEN: HMACIEN Position */
  836. #define CRPT_INTEN_HMACIEN_Msk (0x1ul << CRPT_INTEN_HMACIEN_Pos) /*!< CRPT_T::INTEN: HMACIEN Mask */
  837. #define CRPT_INTEN_HMACEIEN_Pos (25) /*!< CRPT_T::INTEN: HMACEIEN Position */
  838. #define CRPT_INTEN_HMACEIEN_Msk (0x1ul << CRPT_INTEN_HMACEIEN_Pos) /*!< CRPT_T::INTEN: HMACEIEN Mask */
  839. #define CRPT_INTSTS_AESIF_Pos (0) /*!< CRPT_T::INTSTS: AESIF Position */
  840. #define CRPT_INTSTS_AESIF_Msk (0x1ul << CRPT_INTSTS_AESIF_Pos) /*!< CRPT_T::INTSTS: AESIF Mask */
  841. #define CRPT_INTSTS_AESEIF_Pos (1) /*!< CRPT_T::INTSTS: AESEIF Position */
  842. #define CRPT_INTSTS_AESEIF_Msk (0x1ul << CRPT_INTSTS_AESEIF_Pos) /*!< CRPT_T::INTSTS: AESEIF Mask */
  843. #define CRPT_INTSTS_TDESIF_Pos (8) /*!< CRPT_T::INTSTS: TDESIF Position */
  844. #define CRPT_INTSTS_TDESIF_Msk (0x1ul << CRPT_INTSTS_TDESIF_Pos) /*!< CRPT_T::INTSTS: TDESIF Mask */
  845. #define CRPT_INTSTS_TDESEIF_Pos (9) /*!< CRPT_T::INTSTS: TDESEIF Position */
  846. #define CRPT_INTSTS_TDESEIF_Msk (0x1ul << CRPT_INTSTS_TDESEIF_Pos) /*!< CRPT_T::INTSTS: TDESEIF Mask */
  847. #define CRPT_INTSTS_PRNGIF_Pos (16) /*!< CRPT_T::INTSTS: PRNGIF Position */
  848. #define CRPT_INTSTS_PRNGIF_Msk (0x1ul << CRPT_INTSTS_PRNGIF_Pos) /*!< CRPT_T::INTSTS: PRNGIF Mask */
  849. #define CRPT_INTSTS_ECCIF_Pos (22) /*!< CRPT_T::INTSTS: ECCIF Position */
  850. #define CRPT_INTSTS_ECCIF_Msk (0x1ul << CRPT_INTSTS_ECCIF_Pos) /*!< CRPT_T::INTSTS: ECCIF Mask */
  851. #define CRPT_INTSTS_ECCEIF_Pos (23) /*!< CRPT_T::INTSTS: ECCEIF Position */
  852. #define CRPT_INTSTS_ECCEIF_Msk (0x1ul << CRPT_INTSTS_ECCEIF_Pos) /*!< CRPT_T::INTSTS: ECCEIF Mask */
  853. #define CRPT_INTSTS_HMACIF_Pos (24) /*!< CRPT_T::INTSTS: HMACIF Position */
  854. #define CRPT_INTSTS_HMACIF_Msk (0x1ul << CRPT_INTSTS_HMACIF_Pos) /*!< CRPT_T::INTSTS: HMACIF Mask */
  855. #define CRPT_INTSTS_HMACEIF_Pos (25) /*!< CRPT_T::INTSTS: HMACEIF Position */
  856. #define CRPT_INTSTS_HMACEIF_Msk (0x1ul << CRPT_INTSTS_HMACEIF_Pos) /*!< CRPT_T::INTSTS: HMACEIF Mask */
  857. #define CRPT_PRNG_CTL_START_Pos (0) /*!< CRPT_T::PRNG_CTL: START Position */
  858. #define CRPT_PRNG_CTL_START_Msk (0x1ul << CRPT_PRNG_CTL_START_Pos) /*!< CRPT_T::PRNG_CTL: START Mask */
  859. #define CRPT_PRNG_CTL_SEEDRLD_Pos (1) /*!< CRPT_T::PRNG_CTL: SEEDRLD Position */
  860. #define CRPT_PRNG_CTL_SEEDRLD_Msk (0x1ul << CRPT_PRNG_CTL_SEEDRLD_Pos) /*!< CRPT_T::PRNG_CTL: SEEDRLD Mask */
  861. #define CRPT_PRNG_CTL_KEYSZ_Pos (2) /*!< CRPT_T::PRNG_CTL: KEYSZ Position */
  862. #define CRPT_PRNG_CTL_KEYSZ_Msk (0x3ul << CRPT_PRNG_CTL_KEYSZ_Pos) /*!< CRPT_T::PRNG_CTL: KEYSZ Mask */
  863. #define CRPT_PRNG_CTL_BUSY_Pos (8) /*!< CRPT_T::PRNG_CTL: BUSY Position */
  864. #define CRPT_PRNG_CTL_BUSY_Msk (0x1ul << CRPT_PRNG_CTL_BUSY_Pos) /*!< CRPT_T::PRNG_CTL: BUSY Mask */
  865. #define CRPT_PRNG_SEED_SEED_Pos (0) /*!< CRPT_T::PRNG_SEED: SEED Position */
  866. #define CRPT_PRNG_SEED_SEED_Msk (0xfffffffful << CRPT_PRNG_SEED_SEED_Pos) /*!< CRPT_T::PRNG_SEED: SEED Mask */
  867. #define CRPT_PRNG_KEYx_KEY_Pos (0) /*!< CRPT_T::PRNG_KEY[8]: KEY Position */
  868. #define CRPT_PRNG_KEYx_KEY_Msk (0xfffffffful << CRPT_PRNG_KEYx_KEY_Pos) /*!< CRPT_T::PRNG_KEY[8]: KEY Mask */
  869. #define CRPT_AES_FDBCKx_FDBCK_Pos (0) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Position */
  870. #define CRPT_AES_FDBCKx_FDBCK_Msk (0xfffffffful << CRPT_AES_FDBCKx_FDBCK_Pos) /*!< CRPT_T::AES_FDBCK[4]: FDBCK Mask */
  871. #define CRPT_TDES_FDBCKH_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKH: FDBCK Position */
  872. #define CRPT_TDES_FDBCKH_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKH_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKH: FDBCK Mask */
  873. #define CRPT_TDES_FDBCKL_FDBCK_Pos (0) /*!< CRPT_T::TDES_FDBCKL: FDBCK Position */
  874. #define CRPT_TDES_FDBCKL_FDBCK_Msk (0xfffffffful << CRPT_TDES_FDBCKL_FDBCK_Pos) /*!< CRPT_T::TDES_FDBCKL: FDBCK Mask */
  875. #define CRPT_AES_CTL_START_Pos (0) /*!< CRPT_T::AES_CTL: START Position */
  876. #define CRPT_AES_CTL_START_Msk (0x1ul << CRPT_AES_CTL_START_Pos) /*!< CRPT_T::AES_CTL: START Mask */
  877. #define CRPT_AES_CTL_STOP_Pos (1) /*!< CRPT_T::AES_CTL: STOP Position */
  878. #define CRPT_AES_CTL_STOP_Msk (0x1ul << CRPT_AES_CTL_STOP_Pos) /*!< CRPT_T::AES_CTL: STOP Mask */
  879. #define CRPT_AES_CTL_KEYSZ_Pos (2) /*!< CRPT_T::AES_CTL: KEYSZ Position */
  880. #define CRPT_AES_CTL_KEYSZ_Msk (0x3ul << CRPT_AES_CTL_KEYSZ_Pos) /*!< CRPT_T::AES_CTL: KEYSZ Mask */
  881. #define CRPT_AES_CTL_DMALAST_Pos (5) /*!< CRPT_T::AES_CTL: DMALAST Position */
  882. #define CRPT_AES_CTL_DMALAST_Msk (0x1ul << CRPT_AES_CTL_DMALAST_Pos) /*!< CRPT_T::AES_CTL: DMALAST Mask */
  883. #define CRPT_AES_CTL_DMACSCAD_Pos (6) /*!< CRPT_T::AES_CTL: DMACSCAD Position */
  884. #define CRPT_AES_CTL_DMACSCAD_Msk (0x1ul << CRPT_AES_CTL_DMACSCAD_Pos) /*!< CRPT_T::AES_CTL: DMACSCAD Mask */
  885. #define CRPT_AES_CTL_DMAEN_Pos (7) /*!< CRPT_T::AES_CTL: DMAEN Position */
  886. #define CRPT_AES_CTL_DMAEN_Msk (0x1ul << CRPT_AES_CTL_DMAEN_Pos) /*!< CRPT_T::AES_CTL: DMAEN Mask */
  887. #define CRPT_AES_CTL_OPMODE_Pos (8) /*!< CRPT_T::AES_CTL: OPMODE Position */
  888. #define CRPT_AES_CTL_OPMODE_Msk (0xfful << CRPT_AES_CTL_OPMODE_Pos) /*!< CRPT_T::AES_CTL: OPMODE Mask */
  889. #define CRPT_AES_CTL_ENCRPT_Pos (16) /*!< CRPT_T::AES_CTL: ENCRPT Position */
  890. #define CRPT_AES_CTL_ENCRPT_Msk (0x1ul << CRPT_AES_CTL_ENCRPT_Pos) /*!< CRPT_T::AES_CTL: ENCRPT Mask */
  891. #define CRPT_AES_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::AES_CTL: OUTSWAP Position */
  892. #define CRPT_AES_CTL_OUTSWAP_Msk (0x1ul << CRPT_AES_CTL_OUTSWAP_Pos) /*!< CRPT_T::AES_CTL: OUTSWAP Mask */
  893. #define CRPT_AES_CTL_INSWAP_Pos (23) /*!< CRPT_T::AES_CTL: INSWAP Position */
  894. #define CRPT_AES_CTL_INSWAP_Msk (0x1ul << CRPT_AES_CTL_INSWAP_Pos) /*!< CRPT_T::AES_CTL: INSWAP Mask */
  895. #define CRPT_AES_CTL_CHANNEL_Pos (24) /*!< CRPT_T::AES_CTL: CHANNEL Position */
  896. #define CRPT_AES_CTL_CHANNEL_Msk (0x3ul << CRPT_AES_CTL_CHANNEL_Pos) /*!< CRPT_T::AES_CTL: CHANNEL Mask */
  897. #define CRPT_AES_CTL_KEYUNPRT_Pos (26) /*!< CRPT_T::AES_CTL: KEYUNPRT Position */
  898. #define CRPT_AES_CTL_KEYUNPRT_Msk (0x1ful << CRPT_AES_CTL_KEYUNPRT_Pos) /*!< CRPT_T::AES_CTL: KEYUNPRT Mask */
  899. #define CRPT_AES_CTL_KEYPRT_Pos (31) /*!< CRPT_T::AES_CTL: KEYPRT Position */
  900. #define CRPT_AES_CTL_KEYPRT_Msk (0x1ul << CRPT_AES_CTL_KEYPRT_Pos) /*!< CRPT_T::AES_CTL: KEYPRT Mask */
  901. #define CRPT_AES_STS_BUSY_Pos (0) /*!< CRPT_T::AES_STS: BUSY Position */
  902. #define CRPT_AES_STS_BUSY_Msk (0x1ul << CRPT_AES_STS_BUSY_Pos) /*!< CRPT_T::AES_STS: BUSY Mask */
  903. #define CRPT_AES_STS_INBUFEMPTY_Pos (8) /*!< CRPT_T::AES_STS: INBUFEMPTY Position */
  904. #define CRPT_AES_STS_INBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_INBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: INBUFEMPTY Mask */
  905. #define CRPT_AES_STS_INBUFFULL_Pos (9) /*!< CRPT_T::AES_STS: INBUFFULL Position */
  906. #define CRPT_AES_STS_INBUFFULL_Msk (0x1ul << CRPT_AES_STS_INBUFFULL_Pos) /*!< CRPT_T::AES_STS: INBUFFULL Mask */
  907. #define CRPT_AES_STS_INBUFERR_Pos (10) /*!< CRPT_T::AES_STS: INBUFERR Position */
  908. #define CRPT_AES_STS_INBUFERR_Msk (0x1ul << CRPT_AES_STS_INBUFERR_Pos) /*!< CRPT_T::AES_STS: INBUFERR Mask */
  909. #define CRPT_AES_STS_CNTERR_Pos (12) /*!< CRPT_T::AES_STS: CNTERR Position */
  910. #define CRPT_AES_STS_CNTERR_Msk (0x1ul << CRPT_AES_STS_CNTERR_Pos) /*!< CRPT_T::AES_STS: CNTERR Mask */
  911. #define CRPT_AES_STS_OUTBUFEMPTY_Pos (16) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Position */
  912. #define CRPT_AES_STS_OUTBUFEMPTY_Msk (0x1ul << CRPT_AES_STS_OUTBUFEMPTY_Pos) /*!< CRPT_T::AES_STS: OUTBUFEMPTY Mask */
  913. #define CRPT_AES_STS_OUTBUFFULL_Pos (17) /*!< CRPT_T::AES_STS: OUTBUFFULL Position */
  914. #define CRPT_AES_STS_OUTBUFFULL_Msk (0x1ul << CRPT_AES_STS_OUTBUFFULL_Pos) /*!< CRPT_T::AES_STS: OUTBUFFULL Mask */
  915. #define CRPT_AES_STS_OUTBUFERR_Pos (18) /*!< CRPT_T::AES_STS: OUTBUFERR Position */
  916. #define CRPT_AES_STS_OUTBUFERR_Msk (0x1ul << CRPT_AES_STS_OUTBUFERR_Pos) /*!< CRPT_T::AES_STS: OUTBUFERR Mask */
  917. #define CRPT_AES_STS_BUSERR_Pos (20) /*!< CRPT_T::AES_STS: BUSERR Position */
  918. #define CRPT_AES_STS_BUSERR_Msk (0x1ul << CRPT_AES_STS_BUSERR_Pos) /*!< CRPT_T::AES_STS: BUSERR Mask */
  919. #define CRPT_AES_DATIN_DATIN_Pos (0) /*!< CRPT_T::AES_DATIN: DATIN Position */
  920. #define CRPT_AES_DATIN_DATIN_Msk (0xfffffffful << CRPT_AES_DATIN_DATIN_Pos) /*!< CRPT_T::AES_DATIN: DATIN Mask */
  921. #define CRPT_AES_DATOUT_DATOUT_Pos (0) /*!< CRPT_T::AES_DATOUT: DATOUT Position */
  922. #define CRPT_AES_DATOUT_DATOUT_Msk (0xfffffffful << CRPT_AES_DATOUT_DATOUT_Pos) /*!< CRPT_T::AES_DATOUT: DATOUT Mask */
  923. #define CRPT_AES0_KEYx_KEY_Pos (0) /*!< CRPT_T::AES0_KEY[8]: KEY Position */
  924. #define CRPT_AES0_KEYx_KEY_Msk (0xfffffffful << CRPT_AES0_KEYx_KEY_Pos) /*!< CRPT_T::AES0_KEY[8]: KEY Mask */
  925. #define CRPT_AES0_IVx_IV_Pos (0) /*!< CRPT_T::AES0_IV[4]: IV Position */
  926. #define CRPT_AES0_IVx_IV_Msk (0xfffffffful << CRPT_AES0_IVx_IV_Pos) /*!< CRPT_T::AES0_IV[4]: IV Mask */
  927. #define CRPT_AES0_SADDR_SADDR_Pos (0) /*!< CRPT_T::AES0_SADDR: SADDR Position */
  928. #define CRPT_AES0_SADDR_SADDR_Msk (0xfffffffful << CRPT_AES0_SADDR_SADDR_Pos) /*!< CRPT_T::AES0_SADDR: SADDR Mask */
  929. #define CRPT_AES0_DADDR_DADDR_Pos (0) /*!< CRPT_T::AES0_DADDR: DADDR Position */
  930. #define CRPT_AES0_DADDR_DADDR_Msk (0xfffffffful << CRPT_AES0_DADDR_DADDR_Pos) /*!< CRPT_T::AES0_DADDR: DADDR Mask */
  931. #define CRPT_AES0_CNT_CNT_Pos (0) /*!< CRPT_T::AES0_CNT: CNT Position */
  932. #define CRPT_AES0_CNT_CNT_Msk (0xfffffffful << CRPT_AES0_CNT_CNT_Pos) /*!< CRPT_T::AES0_CNT: CNT Mask */
  933. #define CRPT_HMAC_CTL_START_Pos (0) /*!< CRPT_T::HMAC_CTL: START Position */
  934. #define CRPT_HMAC_CTL_START_Msk (0x1ul << CRPT_HMAC_CTL_START_Pos) /*!< CRPT_T::HMAC_CTL: START Mask */
  935. #define CRPT_HMAC_CTL_STOP_Pos (1) /*!< CRPT_T::HMAC_CTL: STOP Position */
  936. #define CRPT_HMAC_CTL_STOP_Msk (0x1ul << CRPT_HMAC_CTL_STOP_Pos) /*!< CRPT_T::HMAC_CTL: STOP Mask */
  937. #define CRPT_HMAC_CTL_HMACEN_Pos (4) /*!< CRPT_T::HMAC_CTL: HMACEN Position */
  938. #define CRPT_HMAC_CTL_HMACEN_Msk (0x1ul << CRPT_HMAC_CTL_HMACEN_Pos) /*!< CRPT_T::HMAC_CTL: HMACEN Mask */
  939. #define CRPT_HMAC_CTL_DMALAST_Pos (5) /*!< CRPT_T::HMAC_CTL: DMALAST Position */
  940. #define CRPT_HMAC_CTL_DMALAST_Msk (0x1ul << CRPT_HMAC_CTL_DMALAST_Pos) /*!< CRPT_T::HMAC_CTL: DMALAST Mask */
  941. #define CRPT_HMAC_CTL_DMAEN_Pos (7) /*!< CRPT_T::HMAC_CTL: DMAEN Position */
  942. #define CRPT_HMAC_CTL_DMAEN_Msk (0x1ul << CRPT_HMAC_CTL_DMAEN_Pos) /*!< CRPT_T::HMAC_CTL: DMAEN Mask */
  943. #define CRPT_HMAC_CTL_OPMODE_Pos (8) /*!< CRPT_T::HMAC_CTL: OPMODE Position */
  944. #define CRPT_HMAC_CTL_OPMODE_Msk (0x7ul << CRPT_HMAC_CTL_OPMODE_Pos) /*!< CRPT_T::HMAC_CTL: OPMODE Mask */
  945. #define CRPT_HMAC_CTL_OUTSWAP_Pos (22) /*!< CRPT_T::HMAC_CTL: OUTSWAP Position */
  946. #define CRPT_HMAC_CTL_OUTSWAP_Msk (0x1ul << CRPT_HMAC_CTL_OUTSWAP_Pos) /*!< CRPT_T::HMAC_CTL: OUTSWAP Mask */
  947. #define CRPT_HMAC_CTL_INSWAP_Pos (23) /*!< CRPT_T::HMAC_CTL: INSWAP Position */
  948. #define CRPT_HMAC_CTL_INSWAP_Msk (0x1ul << CRPT_HMAC_CTL_INSWAP_Pos) /*!< CRPT_T::HMAC_CTL: INSWAP Mask */
  949. #define CRPT_HMAC_STS_BUSY_Pos (0) /*!< CRPT_T::HMAC_STS: BUSY Position */
  950. #define CRPT_HMAC_STS_BUSY_Msk (0x1ul << CRPT_HMAC_STS_BUSY_Pos) /*!< CRPT_T::HMAC_STS: BUSY Mask */
  951. #define CRPT_HMAC_STS_DMABUSY_Pos (1) /*!< CRPT_T::HMAC_STS: DMABUSY Position */
  952. #define CRPT_HMAC_STS_DMABUSY_Msk (0x1ul << CRPT_HMAC_STS_DMABUSY_Pos) /*!< CRPT_T::HMAC_STS: DMABUSY Mask */
  953. #define CRPT_HMAC_STS_DMAERR_Pos (8) /*!< CRPT_T::HMAC_STS: DMAERR Position */
  954. #define CRPT_HMAC_STS_DMAERR_Msk (0x1ul << CRPT_HMAC_STS_DMAERR_Pos) /*!< CRPT_T::HMAC_STS: DMAERR Mask */
  955. #define CRPT_HMAC_STS_DATINREQ_Pos (16) /*!< CRPT_T::HMAC_STS: DATINREQ Position */
  956. #define CRPT_HMAC_STS_DATINREQ_Msk (0x1ul << CRPT_HMAC_STS_DATINREQ_Pos) /*!< CRPT_T::HMAC_STS: DATINREQ Mask */
  957. #define CRPT_HMAC_DGSTx_DGST_Pos (0) /*!< CRPT_T::HMAC_DGST[16]: DGST Position */
  958. #define CRPT_HMAC_DGSTx_DGST_Msk (0xfffffffful << CRPT_HMAC_DGSTx_DGST_Pos) /*!< CRPT_T::HMAC_DGST[16]: DGST Mask */
  959. #define CRPT_HMAC_KEYCNT_KEYCNT_Pos (0) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Position */
  960. #define CRPT_HMAC_KEYCNT_KEYCNT_Msk (0xfffffffful << CRPT_HMAC_KEYCNT_KEYCNT_Pos) /*!< CRPT_T::HMAC_KEYCNT: KEYCNT Mask */
  961. #define CRPT_HMAC_SADDR_SADDR_Pos (0) /*!< CRPT_T::HMAC_SADDR: SADDR Position */
  962. #define CRPT_HMAC_SADDR_SADDR_Msk (0xfffffffful << CRPT_HMAC_SADDR_SADDR_Pos) /*!< CRPT_T::HMAC_SADDR: SADDR Mask */
  963. #define CRPT_HMAC_DMACNT_DMACNT_Pos (0) /*!< CRPT_T::HMAC_DMACNT: DMACNT Position */
  964. #define CRPT_HMAC_DMACNT_DMACNT_Msk (0xfffffffful << CRPT_HMAC_DMACNT_DMACNT_Pos) /*!< CRPT_T::HMAC_DMACNT: DMACNT Mask */
  965. #define CRPT_HMAC_DATIN_DATIN_Pos (0) /*!< CRPT_T::HMAC_DATIN: DATIN Position */
  966. #define CRPT_HMAC_DATIN_DATIN_Msk (0xfffffffful << CRPT_HMAC_DATIN_DATIN_Pos) /*!< CRPT_T::HMAC_DATIN: DATIN Mask */
  967. #define CRPT_ECC_CTL_START_Pos (0) /*!< CRPT_T::ECC_CTL: START Position */
  968. #define CRPT_ECC_CTL_START_Msk (0x1ul << CRPT_ECC_CTL_START_Pos) /*!< CRPT_T::ECC_CTL: START Mask */
  969. #define CRPT_ECC_CTL_STOP_Pos (1) /*!< CRPT_T::ECC_CTL: STOP Position */
  970. #define CRPT_ECC_CTL_STOP_Msk (0x1ul << CRPT_ECC_CTL_STOP_Pos) /*!< CRPT_T::ECC_CTL: STOP Mask */
  971. #define CRPT_ECC_CTL_DMAEN_Pos (7) /*!< CRPT_T::ECC_CTL: DMAEN Position */
  972. #define CRPT_ECC_CTL_DMAEN_Msk (0x1ul << CRPT_ECC_CTL_DMAEN_Pos) /*!< CRPT_T::ECC_CTL: DMAEN Mask */
  973. #define CRPT_ECC_CTL_FSEL_Pos (8) /*!< CRPT_T::ECC_CTL: FSEL Position */
  974. #define CRPT_ECC_CTL_FSEL_Msk (0x1ul << CRPT_ECC_CTL_FSEL_Pos) /*!< CRPT_T::ECC_CTL: FSEL Mask */
  975. #define CRPT_ECC_CTL_ECCOP_Pos (9) /*!< CRPT_T::ECC_CTL: ECCOP Position */
  976. #define CRPT_ECC_CTL_ECCOP_Msk (0x3ul << CRPT_ECC_CTL_ECCOP_Pos) /*!< CRPT_T::ECC_CTL: ECCOP Mask */
  977. #define CRPT_ECC_CTL_MODOP_Pos (11) /*!< CRPT_T::ECC_CTL: MODOP Position */
  978. #define CRPT_ECC_CTL_MODOP_Msk (0x3ul << CRPT_ECC_CTL_MODOP_Pos) /*!< CRPT_T::ECC_CTL: MODOP Mask */
  979. #define CRPT_ECC_CTL_LDP1_Pos (16) /*!< CRPT_T::ECC_CTL: LDP1 Position */
  980. #define CRPT_ECC_CTL_LDP1_Msk (0x1ul << CRPT_ECC_CTL_LDP1_Pos) /*!< CRPT_T::ECC_CTL: LDP1 Mask */
  981. #define CRPT_ECC_CTL_LDP2_Pos (17) /*!< CRPT_T::ECC_CTL: LDP2 Position */
  982. #define CRPT_ECC_CTL_LDP2_Msk (0x1ul << CRPT_ECC_CTL_LDP2_Pos) /*!< CRPT_T::ECC_CTL: LDP2 Mask */
  983. #define CRPT_ECC_CTL_LDA_Pos (18) /*!< CRPT_T::ECC_CTL: LDA Position */
  984. #define CRPT_ECC_CTL_LDA_Msk (0x1ul << CRPT_ECC_CTL_LDA_Pos) /*!< CRPT_T::ECC_CTL: LDA Mask */
  985. #define CRPT_ECC_CTL_LDB_Pos (19) /*!< CRPT_T::ECC_CTL: LDB Position */
  986. #define CRPT_ECC_CTL_LDB_Msk (0x1ul << CRPT_ECC_CTL_LDB_Pos) /*!< CRPT_T::ECC_CTL: LDB Mask */
  987. #define CRPT_ECC_CTL_LDN_Pos (20) /*!< CRPT_T::ECC_CTL: LDN Position */
  988. #define CRPT_ECC_CTL_LDN_Msk (0x1ul << CRPT_ECC_CTL_LDN_Pos) /*!< CRPT_T::ECC_CTL: LDN Mask */
  989. #define CRPT_ECC_CTL_LDK_Pos (21) /*!< CRPT_T::ECC_CTL: LDK Position */
  990. #define CRPT_ECC_CTL_LDK_Msk (0x1ul << CRPT_ECC_CTL_LDK_Pos) /*!< CRPT_T::ECC_CTL: LDK Mask */
  991. #define CRPT_ECC_CTL_CURVEM_Pos (22) /*!< CRPT_T::ECC_CTL: CURVEM Position */
  992. #define CRPT_ECC_CTL_CURVEM_Msk (0x3fful << CRPT_ECC_CTL_CURVEM_Pos) /*!< CRPT_T::ECC_CTL: CURVEM Mask */
  993. #define CRPT_ECC_STS_BUSY_Pos (0) /*!< CRPT_T::ECC_STS: BUSY Position */
  994. #define CRPT_ECC_STS_BUSY_Msk (0x1ul << CRPT_ECC_STS_BUSY_Pos) /*!< CRPT_T::ECC_STS: BUSY Mask */
  995. #define CRPT_ECC_STS_DMABUSY_Pos (1) /*!< CRPT_T::ECC_STS: DMABUSY Position */
  996. #define CRPT_ECC_STS_DMABUSY_Msk (0x1ul << CRPT_ECC_STS_DMABUSY_Pos) /*!< CRPT_T::ECC_STS: DMABUSY Mask */
  997. #define CRPT_ECC_STS_BUSERR_Pos (16) /*!< CRPT_T::ECC_STS: BUSERR Position */
  998. #define CRPT_ECC_STS_BUSERR_Msk (0x1ul << CRPT_ECC_STS_BUSERR_Pos) /*!< CRPT_T::ECC_STS: BUSERR Mask */
  999. #define CRPT_ECC_X1_POINTX1_Pos (0) /*!< CRPT_T::ECC_X1[18]: POINTX1 Position */
  1000. #define CRPT_ECC_X1_POINTX1_Msk (0xfffffffful << CRPT_ECC_X1_POINTX1_Pos) /*!< CRPT_T::ECC_X1[18]: POINTX1 Mask */
  1001. #define CRPT_ECC_Y1_POINTY1_Pos (0) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Position */
  1002. #define CRPT_ECC_Y1_POINTY1_Msk (0xfffffffful << CRPT_ECC_Y1_POINTY1_Pos) /*!< CRPT_T::ECC_Y1[18]: POINTY1 Mask */
  1003. #define CRPT_ECC_X2_POINTX2_Pos (0) /*!< CRPT_T::ECC_X2[18]: POINTX2 Position */
  1004. #define CRPT_ECC_X2_POINTX2_Msk (0xfffffffful << CRPT_ECC_X2_POINTX2_Pos) /*!< CRPT_T::ECC_X2[18]: POINTX2 Mask */
  1005. #define CRPT_ECC_Y2_POINTY2_Pos (0) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Position */
  1006. #define CRPT_ECC_Y2_POINTY2_Msk (0xfffffffful << CRPT_ECC_Y2_POINTY2_Pos) /*!< CRPT_T::ECC_Y2[18]: POINTY2 Mask */
  1007. #define CRPT_ECC_A_CURVEA_Pos (0) /*!< CRPT_T::ECC_A[18]: CURVEA Position */
  1008. #define CRPT_ECC_A_CURVEA_Msk (0xfffffffful << CRPT_ECC_A_CURVEA_Pos) /*!< CRPT_T::ECC_A[18]: CURVEA Mask */
  1009. #define CRPT_ECC_B_CURVEB_Pos (0) /*!< CRPT_T::ECC_B[18]: CURVEB Position */
  1010. #define CRPT_ECC_B_CURVEB_Msk (0xfffffffful << CRPT_ECC_B_CURVEB_Pos) /*!< CRPT_T::ECC_B[18]: CURVEB Mask */
  1011. #define CRPT_ECC_N_CURVEN_Pos (0) /*!< CRPT_T::ECC_N[18]: CURVEN Position */
  1012. #define CRPT_ECC_N_CURVEN_Msk (0xfffffffful << CRPT_ECC_N_CURVEN_Pos) /*!< CRPT_T::ECC_N[18]: CURVEN Mask */
  1013. #define CRPT_ECC_K_SCALARK_Pos (0) /*!< CRPT_T::ECC_K[18]: SCALARK Position */
  1014. #define CRPT_ECC_K_SCALARK_Msk (0xfffffffful << CRPT_ECC_K_SCALARK_Pos) /*!< CRPT_T::ECC_K[18]: SCALARK Mask */
  1015. #define CRPT_ECC_DADDR_DADDR_Pos (0) /*!< CRPT_T::ECC_DADDR: DADDR Position */
  1016. #define CRPT_ECC_DADDR_DADDR_Msk (0xfffffffful << CRPT_ECC_DADDR_DADDR_Pos) /*!< CRPT_T::ECC_DADDR: DADDR Mask */
  1017. #define CRPT_ECC_STARTREG_STARTREG_Pos (0) /*!< CRPT_T::ECC_STARTREG: STARTREG Position*/
  1018. #define CRPT_ECC_STARTREG_STARTREG_Msk (0xfffffffful << CRPT_ECC_STARTREG_STARTREG_Pos) /*!< CRPT_T::ECC_STARTREG: STARTREG Mask */
  1019. #define CRPT_ECC_WORDCNT_WORDCNT_Pos (0) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Position */
  1020. #define CRPT_ECC_WORDCNT_WORDCNT_Msk (0xfffffffful << CRPT_ECC_WORDCNT_WORDCNT_Pos) /*!< CRPT_T::ECC_WORDCNT: WORDCNT Mask */
  1021. #define CRPT_RSA_CTL_START_Pos (0) /*!< CRPT RSA_CTL: START Position */
  1022. #define CRPT_RSA_CTL_START_Msk (0x1ul << CRPT_RSA_CTL_START_Pos) /*!< CRPT RSA_CTL: START Mask */
  1023. #define CRPT_RSA_CTL_STOP_Pos (1) /*!< CRPT RSA_CTL: STOP Position */
  1024. #define CRPT_RSA_CTL_STOP_Msk (0x1ul << CRPT_RSA_CTL_STOP_Pos) /*!< CRPT RSA_CTL: STOP Mask */
  1025. #define CRPT_RSA_CTL_DMAEN_Pos (7) /*!< CRPT RSA_CTL: DMAEN Position */
  1026. #define CRPT_RSA_CTL_DMAEN_Msk (0x1ul << CRPT_RSA_CTL_DMAEN_Pos) /*!< CRPT RSA_CTL: DMAEN Mask */
  1027. #define CRPT_RSA_CTL_LDM_Pos (8) /*!< CRPT RSA_CTL: LDM Position */
  1028. #define CRPT_RSA_CTL_LDM_Msk (0x1ul << CRPT_RSA_CTL_LDM_Pos) /*!< CRPT RSA_CTL: LDM Mask */
  1029. #define CRPT_RSA_CTL_LDE_Pos (9) /*!< CRPT RSA_CTL: LDE Position */
  1030. #define CRPT_RSA_CTL_LDE_Msk (0x1ul << CRPT_RSA_CTL_LDE_Pos) /*!< CRPT RSA_CTL: LDE Mask */
  1031. #define CRPT_RSA_CTL_LDN_Pos (10) /*!< CRPT RSA_CTL: LDN Position */
  1032. #define CRPT_RSA_CTL_LDN_Msk (0x1ul << CRPT_RSA_CTL_LDN_Pos) /*!< CRPT RSA_CTL: LDN Mask */
  1033. #define CRPT_RSA_CTL_LDC_Pos (11) /*!< CRPT RSA_CTL: LDC Position */
  1034. #define CRPT_RSA_CTL_LDC_Msk (0x1ul << CRPT_RSA_CTL_LDC_Pos) /*!< CRPT RSA_CTL: LDC Mask */
  1035. #define CRPT_RSA_CTL_KEYLEN_Pos (16) /*!< CRPT RSA_CTL: KEYLEN Position */
  1036. #define CRPT_RSA_CTL_KEYLEN_Msk (0x1FFFul << CRPT_RSA_CTL_KEYLEN_Pos) /*!< CRPT RSA_CTL: KEYLEN Mask */
  1037. #define CRPT_RSA_STS_BUSY_Pos (0) /*!< CRPT RSA_STS: BUSY Position */
  1038. #define CRPT_RSA_STS_BUSY_Msk (0x1ul << CRPT_RSA_STS_BUSY_Pos) /*!< CRPT RSA_STS: BUSY Mask */
  1039. #define CRPT_RSA_STS_DMABUSY_Pos (1) /*!< CRPT RSA_STS: DMABUSY Position */
  1040. #define CRPT_RSA_STS_DMABUSY_Msk (0x1ul << CRPT_RSA_STS_DMABUSY_Pos) /*!< CRPT RSA_STS: DMABUSY Mask */
  1041. #define CRPT_RSA_STS_BUSERR_Pos (16) /*!< CRPT ECC_RSA: BUSERR Position */
  1042. #define CRPT_RSA_STS_BUSERR_Msk (0x1ul << CRPT_RSA_STS_BUSERR_Pos) /*!< CRPT ECC_RSA: BUSERR Mask */
  1043. /**@}*/ /* CRPT_CONST CRYPTO */
  1044. /**@}*/ /* end of CRYPTO register group */
  1045. /** @addtogroup CRYPTO_EXPORTED_CONSTANTS CRYPTO Exported Constants
  1046. @{
  1047. */
  1048. #define PRNG_KEY_SIZE_64 0UL /*!< Select to generate 64-bit random key \hideinitializer */
  1049. #define PRNG_KEY_SIZE_128 1UL /*!< Select to generate 128-bit random key \hideinitializer */
  1050. #define PRNG_KEY_SIZE_192 2UL /*!< Select to generate 192-bit random key \hideinitializer */
  1051. #define PRNG_KEY_SIZE_256 3UL /*!< Select to generate 256-bit random key \hideinitializer */
  1052. #define PRNG_SEED_CONT 0UL /*!< PRNG using current seed \hideinitializer */
  1053. #define PRNG_SEED_RELOAD 1UL /*!< PRNG reload new seed \hideinitializer */
  1054. #define AES_KEY_SIZE_128 0UL /*!< AES select 128-bit key length \hideinitializer */
  1055. #define AES_KEY_SIZE_192 1UL /*!< AES select 192-bit key length \hideinitializer */
  1056. #define AES_KEY_SIZE_256 2UL /*!< AES select 256-bit key length \hideinitializer */
  1057. #define AES_MODE_ECB 0UL /*!< AES select ECB mode \hideinitializer */
  1058. #define AES_MODE_CBC 1UL /*!< AES select CBC mode \hideinitializer */
  1059. #define AES_MODE_CFB 2UL /*!< AES select CFB mode \hideinitializer */
  1060. #define AES_MODE_OFB 3UL /*!< AES select OFB mode \hideinitializer */
  1061. #define AES_MODE_CTR 4UL /*!< AES select CTR mode \hideinitializer */
  1062. #define AES_MODE_CBC_CS1 0x10UL /*!< AES select CBC CS1 mode \hideinitializer */
  1063. #define AES_MODE_CBC_CS2 0x11UL /*!< AES select CBC CS2 mode \hideinitializer */
  1064. #define AES_MODE_CBC_CS3 0x12UL /*!< AES select CBC CS3 mode \hideinitializer */
  1065. #define AES_NO_SWAP 0UL /*!< AES do not swap input and output data \hideinitializer */
  1066. #define AES_OUT_SWAP 1UL /*!< AES swap output data \hideinitializer */
  1067. #define AES_IN_SWAP 2UL /*!< AES swap input data \hideinitializer */
  1068. #define AES_IN_OUT_SWAP 3UL /*!< AES swap both input and output data \hideinitializer */
  1069. #define SHA_MODE_SHA1 0UL /*!< SHA select SHA-1 160-bit \hideinitializer */
  1070. #define SHA_MODE_SHA224 5UL /*!< SHA select SHA-224 224-bit \hideinitializer */
  1071. #define SHA_MODE_SHA256 4UL /*!< SHA select SHA-256 256-bit \hideinitializer */
  1072. #define SHA_MODE_SHA384 7UL /*!< SHA select SHA-384 384-bit \hideinitializer */
  1073. #define SHA_MODE_SHA512 6UL /*!< SHA select SHA-512 512-bit \hideinitializer */
  1074. #define SHA_NO_SWAP 0UL /*!< SHA do not swap input and output data \hideinitializer */
  1075. #define SHA_OUT_SWAP 1UL /*!< SHA swap output data \hideinitializer */
  1076. #define SHA_IN_SWAP 2UL /*!< SHA swap input data \hideinitializer */
  1077. #define SHA_IN_OUT_SWAP 3UL /*!< SHA swap both input and output data \hideinitializer */
  1078. #define CRYPTO_DMA_FIRST 0x4UL /*!< Do first encrypt/decrypt in DMA cascade \hideinitializer */
  1079. #define CRYPTO_DMA_ONE_SHOT 0x5UL /*!< Do one shot encrypt/decrypt with DMA \hideinitializer */
  1080. #define CRYPTO_DMA_CONTINUE 0x6UL /*!< Do continuous encrypt/decrypt in DMA cascade \hideinitializer */
  1081. #define CRYPTO_DMA_LAST 0x7UL /*!< Do last encrypt/decrypt in DMA cascade \hideinitializer */
  1082. typedef enum
  1083. {
  1084. /*!< ECC curve \hideinitializer */
  1085. CURVE_P_192, /*!< ECC curve P-192 \hideinitializer */
  1086. CURVE_P_224, /*!< ECC curve P-224 \hideinitializer */
  1087. CURVE_P_256, /*!< ECC curve P-256 \hideinitializer */
  1088. CURVE_P_384, /*!< ECC curve P-384 \hideinitializer */
  1089. CURVE_P_521, /*!< ECC curve P-521 \hideinitializer */
  1090. CURVE_K_163, /*!< ECC curve K-163 \hideinitializer */
  1091. CURVE_K_233, /*!< ECC curve K-233 \hideinitializer */
  1092. CURVE_K_283, /*!< ECC curve K-283 \hideinitializer */
  1093. CURVE_K_409, /*!< ECC curve K-409 \hideinitializer */
  1094. CURVE_K_571, /*!< ECC curve K-571 \hideinitializer */
  1095. CURVE_B_163, /*!< ECC curve B-163 \hideinitializer */
  1096. CURVE_B_233, /*!< ECC curve B-233 \hideinitializer */
  1097. CURVE_B_283, /*!< ECC curve B-283 \hideinitializer */
  1098. CURVE_B_409, /*!< ECC curve B-409 \hideinitializer */
  1099. CURVE_B_571, /*!< ECC curve K-571 \hideinitializer */
  1100. CURVE_KO_192, /*!< ECC 192-bits "Koblitz" curve \hideinitializer */
  1101. CURVE_KO_224, /*!< ECC 224-bits "Koblitz" curve \hideinitializer */
  1102. CURVE_KO_256, /*!< ECC 256-bits "Koblitz" curve \hideinitializer */
  1103. CURVE_BP_256, /*!< ECC Brainpool 256-bits curve \hideinitializer */
  1104. CURVE_BP_384, /*!< ECC Brainpool 256-bits curve \hideinitializer */
  1105. CURVE_BP_512, /*!< ECC Brainpool 256-bits curve \hideinitializer */
  1106. CURVE_UNDEF, /*!< Invalid curve \hideinitializer */
  1107. }
  1108. E_ECC_CURVE; /*!< ECC curve \hideinitializer */
  1109. #define RSA_MAX_KLEN (2048)
  1110. #define RSA_KBUF_HLEN (RSA_MAX_KLEN/4 + 8)
  1111. #define RSA_KBUF_BLEN (RSA_MAX_KLEN + 32)
  1112. /*@}*/ /* end of group CRYPTO_EXPORTED_CONSTANTS */
  1113. /** @addtogroup CRYPTO_EXPORTED_MACROS CRYPTO Exported Macros
  1114. @{
  1115. */
  1116. /*----------------------------------------------------------------------------------------------*/
  1117. /* Macros */
  1118. /*----------------------------------------------------------------------------------------------*/
  1119. /**
  1120. * @brief This macro enables PRNG interrupt.
  1121. * @param crpt Specified cripto module
  1122. * @return None
  1123. * \hideinitializer
  1124. */
  1125. #define PRNG_ENABLE_INT(crpt) ((crpt)->INTEN |= CRPT_INTEN_PRNGIEN_Msk)
  1126. /**
  1127. * @brief This macro disables PRNG interrupt.
  1128. * @param crpt Specified cripto module
  1129. * @return None
  1130. * \hideinitializer
  1131. */
  1132. #define PRNG_DISABLE_INT(crpt) ((crpt)->INTEN &= ~CRPT_INTEN_PRNGIEN_Msk)
  1133. /**
  1134. * @brief This macro gets PRNG interrupt flag.
  1135. * @param crpt Specified cripto module
  1136. * @return PRNG interrupt flag.
  1137. * \hideinitializer
  1138. */
  1139. #define PRNG_GET_INT_FLAG(crpt) ((crpt)->INTSTS & CRPT_INTSTS_PRNGIF_Msk)
  1140. /**
  1141. * @brief This macro clears PRNG interrupt flag.
  1142. * @param crpt Specified cripto module
  1143. * @return None
  1144. * \hideinitializer
  1145. */
  1146. #define PRNG_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = CRPT_INTSTS_PRNGIF_Msk)
  1147. /**
  1148. * @brief This macro enables AES interrupt.
  1149. * @param crpt Specified cripto module
  1150. * @return None
  1151. * \hideinitializer
  1152. */
  1153. #define AES_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk))
  1154. /**
  1155. * @brief This macro disables AES interrupt.
  1156. * @param crpt Specified cripto module
  1157. * @return None
  1158. * \hideinitializer
  1159. */
  1160. #define AES_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_AESIEN_Msk|CRPT_INTEN_AESEIEN_Msk))
  1161. /**
  1162. * @brief This macro gets AES interrupt flag.
  1163. * @param crpt Specified cripto module
  1164. * @return AES interrupt flag.
  1165. * \hideinitializer
  1166. */
  1167. #define AES_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk))
  1168. /**
  1169. * @brief This macro clears AES interrupt flag.
  1170. * @param crpt Specified cripto module
  1171. * @return None
  1172. * \hideinitializer
  1173. */
  1174. #define AES_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_AESIF_Msk|CRPT_INTSTS_AESEIF_Msk))
  1175. /**
  1176. * @brief This macro enables AES key protection.
  1177. * @param crpt Specified cripto module
  1178. * @return None
  1179. * \hideinitializer
  1180. */
  1181. #define AES_ENABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL |= CRPT_AES_CTL_KEYPRT_Msk)
  1182. /**
  1183. * @brief This macro disables AES key protection.
  1184. * @param crpt Specified cripto module
  1185. * @return None
  1186. * \hideinitializer
  1187. */
  1188. #define AES_DISABLE_KEY_PROTECT(crpt) ((crpt)->AES_CTL = ((crpt)->AES_CTL & ~CRPT_AES_CTL_KEYPRT_Msk) | (0x16UL<<CRPT_AES_CTL_KEYUNPRT_Pos)); \
  1189. ((crpt)->AES_CTL &= ~CRPT_AES_CTL_KEYPRT_Msk)
  1190. /**
  1191. * @brief This macro enables SHA interrupt.
  1192. * @param crpt Specified cripto module
  1193. * @return None
  1194. * \hideinitializer
  1195. */
  1196. #define SHA_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk))
  1197. /**
  1198. * @brief This macro disables SHA interrupt.
  1199. * @param crpt Specified cripto module
  1200. * @return None
  1201. * \hideinitializer
  1202. */
  1203. #define SHA_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_HMACIEN_Msk|CRPT_INTEN_HMACEIEN_Msk))
  1204. /**
  1205. * @brief This macro gets SHA interrupt flag.
  1206. * @param crpt Specified cripto module
  1207. * @return SHA interrupt flag.
  1208. * \hideinitializer
  1209. */
  1210. #define SHA_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk))
  1211. /**
  1212. * @brief This macro clears SHA interrupt flag.
  1213. * @param crpt Specified cripto module
  1214. * @return None
  1215. * \hideinitializer
  1216. */
  1217. #define SHA_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_HMACIF_Msk|CRPT_INTSTS_HMACEIF_Msk))
  1218. /**
  1219. * @brief This macro enables ECC interrupt.
  1220. * @param crpt Specified cripto module
  1221. * @return None
  1222. * \hideinitializer
  1223. */
  1224. #define ECC_ENABLE_INT(crpt) ((crpt)->INTEN |= (CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk))
  1225. /**
  1226. * @brief This macro disables ECC interrupt.
  1227. * @param crpt Specified cripto module
  1228. * @return None
  1229. * \hideinitializer
  1230. */
  1231. #define ECC_DISABLE_INT(crpt) ((crpt)->INTEN &= ~(CRPT_INTEN_ECCIEN_Msk|CRPT_INTEN_ECCEIEN_Msk))
  1232. /**
  1233. * @brief This macro gets ECC interrupt flag.
  1234. * @param crpt Specified cripto module
  1235. * @return ECC interrupt flag.
  1236. * \hideinitializer
  1237. */
  1238. #define ECC_GET_INT_FLAG(crpt) ((crpt)->INTSTS & (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk))
  1239. /**
  1240. * @brief This macro clears ECC interrupt flag.
  1241. * @param crpt Specified cripto module
  1242. * @return None
  1243. * \hideinitializer
  1244. */
  1245. #define ECC_CLR_INT_FLAG(crpt) ((crpt)->INTSTS = (CRPT_INTSTS_ECCIF_Msk|CRPT_INTSTS_ECCEIF_Msk))
  1246. /*@}*/ /* end of group CRYPTO_EXPORTED_MACROS */
  1247. /** @addtogroup CRYPTO_EXPORTED_FUNCTIONS CRYPTO Exported Functions
  1248. @{
  1249. */
  1250. /*---------------------------------------------------------------------------------------------------------*/
  1251. /* Functions */
  1252. /*---------------------------------------------------------------------------------------------------------*/
  1253. void PRNG_Open(CRPT_T *crpt, uint32_t u32KeySize, uint32_t u32SeedReload, uint32_t u32Seed);
  1254. void PRNG_Start(CRPT_T *crpt);
  1255. void PRNG_Read(CRPT_T *crpt, uint32_t u32RandKey[]);
  1256. void AES_Open(CRPT_T *crpt, uint32_t u32EncDec, uint32_t u32OpMode, uint32_t u32KeySize, uint32_t u32SwapType);
  1257. void AES_Start(CRPT_T *crpt, uint32_t u32DMAMode);
  1258. void AES_SetKey(CRPT_T *crpt, uint32_t au32Keys[], uint32_t u32KeySize);
  1259. void AES_SetInitVect(CRPT_T *crpt, uint32_t au32IV[]);
  1260. void AES_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32DstAddr, uint32_t u32TransCnt);
  1261. void SHA_Open(CRPT_T *crpt, uint32_t u32OpMode, uint32_t u32SwapType, uint32_t hmac_key_len);
  1262. void SHA_Start(CRPT_T *crpt, uint32_t u32DMAMode);
  1263. void SHA_SetDMATransfer(CRPT_T *crpt, uint32_t u32SrcAddr, uint32_t u32TransCnt);
  1264. void SHA_Read(CRPT_T *crpt, uint32_t u32Digest[]);
  1265. void ECC_Complete(CRPT_T *crpt);
  1266. int ECC_IsPrivateKeyValid(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char private_k[]);
  1267. int32_t ECC_GeneratePublicKey(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[]);
  1268. int32_t ECC_Mutiply(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char x1[], char y1[], char *k, char x2[], char y2[]);
  1269. int32_t ECC_GenerateSecretZ(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *private_k, char public_k1[], char public_k2[], char secret_z[]);
  1270. int32_t ECC_GenerateSignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *d, char *k, char *R, char *S);
  1271. int32_t ECC_VerifySignature(CRPT_T *crpt, E_ECC_CURVE ecc_curve, char *message, char *public_k1, char *public_k2, char *R, char *S);
  1272. void RSA_Calculate_C(int rsa_len, char *n, char *C);
  1273. int32_t RSA_GenerateSignature(CRPT_T *crpt, int rsa_len, char *n, char *d, char *C, char *msg, char *sig);
  1274. int32_t RSA_VerifySignature(CRPT_T *crpt, int rsa_len, char *n, char *e, char *C, char *sig, char *msg);
  1275. /*@}*/ /* end of group CRYPTO_EXPORTED_FUNCTIONS */
  1276. /*@}*/ /* end of group Crypto_Driver */
  1277. /*@}*/ /* end of group Standard_Driver */
  1278. #ifdef __cplusplus
  1279. }
  1280. #endif
  1281. #endif /* __NU_CRYPTO_H__ */
  1282. /*** (C) COPYRIGHT 2018 Nuvoton Technology Corp. ***/