CC13xx Driver Library
crypto.h
Go to the documentation of this file.
1 /******************************************************************************
2 * Filename: crypto.h
3 * Revised: 2016-04-24 00:47:02 +0200 (Sun, 24 Apr 2016)
4 * Revision: 46129
5 *
6 * Description: AES header file.
7 *
8 * Copyright (c) 2015 - 2016, Texas Instruments Incorporated
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are met:
13 *
14 * 1) Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * 2) Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 *
21 * 3) Neither the name of the ORGANIZATION nor the names of its contributors may
22 * be used to endorse or promote products derived from this software without
23 * specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE.
36 *
37 ******************************************************************************/
38 
39 //*****************************************************************************
40 //
45 //
46 //*****************************************************************************
47 
48 #ifndef __CRYPTO_H__
49 #define __CRYPTO_H__
50 
51 //*****************************************************************************
52 //
53 // If building with a C++ compiler, make all of the definitions in this header
54 // have a C binding.
55 //
56 //*****************************************************************************
57 #ifdef __cplusplus
58 extern "C"
59 {
60 #endif
61 
62 #include <stdbool.h>
63 #include <stdint.h>
64 #include <inc/hw_types.h>
65 #include <inc/hw_memmap.h>
66 #include <inc/hw_ints.h>
67 #include <inc/hw_crypto.h>
68 #include <driverlib/debug.h>
69 #include <driverlib/interrupt.h>
70 #include <driverlib/cpu.h>
71 
72 //*****************************************************************************
73 //
74 // Support for DriverLib in ROM:
75 // This section renames all functions that are not "static inline", so that
76 // calling these functions will default to implementation in flash. At the end
77 // of this file a second renaming will change the defaults to implementation in
78 // ROM for available functions.
79 //
80 // To force use of the implementation in flash, e.g. for debugging:
81 // - Globally: Define DRIVERLIB_NOROM at project level
82 // - Per function: Use prefix "NOROM_" when calling the function
83 //
84 //*****************************************************************************
85 #if !defined(DOXYGEN)
86  #define CRYPTOAesLoadKey NOROM_CRYPTOAesLoadKey
87  #define CRYPTOAesCbc NOROM_CRYPTOAesCbc
88  #define CRYPTOAesCbcStatus NOROM_CRYPTOAesCbcStatus
89  #define CRYPTOAesEcb NOROM_CRYPTOAesEcb
90  #define CRYPTOAesEcbStatus NOROM_CRYPTOAesEcbStatus
91  #define CRYPTOCcmAuthEncrypt NOROM_CRYPTOCcmAuthEncrypt
92  #define CRYPTOCcmAuthEncryptStatus NOROM_CRYPTOCcmAuthEncryptStatus
93  #define CRYPTOCcmAuthEncryptResultGet NOROM_CRYPTOCcmAuthEncryptResultGet
94  #define CRYPTOCcmInvAuthDecrypt NOROM_CRYPTOCcmInvAuthDecrypt
95  #define CRYPTOCcmInvAuthDecryptStatus NOROM_CRYPTOCcmInvAuthDecryptStatus
96  #define CRYPTOCcmInvAuthDecryptResultGet NOROM_CRYPTOCcmInvAuthDecryptResultGet
97  #define CRYPTODmaEnable NOROM_CRYPTODmaEnable
98  #define CRYPTODmaDisable NOROM_CRYPTODmaDisable
99 #endif
100 
101 //*****************************************************************************
102 //
103 // Length of AES Electronic Code Book (ECB) block in bytes
104 //
105 //*****************************************************************************
106 #define AES_ECB_LENGTH 16
107 
108 //*****************************************************************************
109 //
110 // Values that can be passed to CryptoIntEnable, CryptoIntDisable, and CryptoIntClear
111 // as the ui32IntFlags parameter, and returned from CryptoIntStatus.
112 //
113 //*****************************************************************************
114 #define CRYPTO_DMA_IN_DONE 0x00000002 // DMA done interrupt mask
115 #define CRYPTO_RESULT_RDY 0x00000001 // Result ready interrupt mask
116 #define CRYPTO_DMA_BUS_ERR 0x80000000 // DMA Bus error
117 #define CRYPTO_KEY_ST_WR_ERR 0x40000000 // Key Store Write failed
118 #define CRYPTO_KEY_ST_RD_ERR 0x20000000 // Key Store Read failed
119 
120 #define CRYPTO_IRQTYPE_LEVEL 0x00000001 // Crypto Level interrupt enabled
121 #define CRYPTO_IRQTYPE_PULSE 0x00000000 // Crypto pulse interrupt enabled
122 
123 #define CRYPTO_DMA_CHAN0 0x00000001 // Crypto DMA Channel 0
124 #define CRYPTO_DMA_CHAN1 0x00000002 // Crypto DMA Channel 1
125 
126 #define CRYPTO_AES128_ENCRYPT 0x0000000C //
127 #define CRYPTO_AES128_DECRYPT 0x00000008 //
128 
129 #define CRYPTO_DMA_READY 0x00000000 // DMA ready
130 #define CRYPTO_DMA_BSY 0x00000003 // DMA busy
131 #define CRYPTO_DMA_BUS_ERROR 0x00020000 // DMA encountered bus error
132 
133 //*****************************************************************************
134 //
135 // General constants
136 //
137 //*****************************************************************************
138 
139 // AES module return codes
140 #define AES_SUCCESS 0
141 #define AES_KEYSTORE_READ_ERROR 1
142 #define AES_KEYSTORE_WRITE_ERROR 2
143 #define AES_DMA_BUS_ERROR 3
144 #define CCM_AUTHENTICATION_FAILED 4
145 #define AES_ECB_TEST_ERROR 8
146 #define AES_NULL_ERROR 9
147 #define AES_CCM_TEST_ERROR 10
148 #define AES_DMA_BSY 11
149 
150 // Key store module defines
151 #define STATE_BLENGTH 16 // Number of bytes in State
152 #define KEY_BLENGTH 16 // Number of bytes in Key
153 #define KEY_EXP_LENGTH 176 // Nb * (Nr+1) * 4
154 
155 #define KEY_STORE_SIZE_128 0x00000001
156 #define KEY_STORE_SIZE_192 0x00000002
157 #define KEY_STORE_SIZE_256 0x00000003
158 #define KEY_STORE_SIZE_BITS 0x00000003
159 
160 //*****************************************************************************
161 //
162 // For 128 bit key all 8 Key Area locations from 0 to 8 are valid
163 // However for 192 bit and 256 bit keys, only even Key Areas 0, 2, 4, 6
164 // are valid.
165 //
166 //*****************************************************************************
167 #define CRYPTO_KEY_AREA_0 0
168 #define CRYPTO_KEY_AREA_1 1
169 #define CRYPTO_KEY_AREA_2 2
170 #define CRYPTO_KEY_AREA_3 3
171 #define CRYPTO_KEY_AREA_4 4
172 #define CRYPTO_KEY_AREA_5 5
173 #define CRYPTO_KEY_AREA_6 6
174 #define CRYPTO_KEY_AREA_7 7
175 
176 //*****************************************************************************
177 //
178 // Defines for the current AES operation
179 //
180 //*****************************************************************************
181 #define CRYPTO_AES_NONE 0
182 #define CRYPTO_AES_KEYL0AD 1
183 #define CRYPTO_AES_ECB 2
184 #define CRYPTO_AES_CCM 3
185 #define CRYPTO_AES_RNG 4
186 #define CRYPTO_AES_CBC 5
187 
188 //*****************************************************************************
189 //
190 // Defines for the AES-CTR mode counter width
191 //
192 //*****************************************************************************
193 #define CRYPTO_AES_CTR_32 0x0
194 #define CRYPTO_AES_CTR_64 0x1
195 #define CRYPTO_AES_CTR_96 0x2
196 #define CRYPTO_AES_CTR_128 0x3
197 
198 //*****************************************************************************
199 //
200 // API Functions and prototypes
201 //
202 //*****************************************************************************
203 
204 //*****************************************************************************
205 //
228 //
229 //*****************************************************************************
230 extern uint32_t CRYPTOAesLoadKey(uint32_t *pui32AesKey,
231  uint32_t ui32KeyLocation);
232 
233 //*****************************************************************************
234 //
264 //
265 //*****************************************************************************
266 extern uint32_t CRYPTOAesCbc(uint32_t *pui32MsgIn, uint32_t *pui32MsgOut,
267  uint32_t ui32MsgLength, uint32_t *pui32Nonce,
268  uint32_t ui32KeyLocation, bool bEncrypt,
269  bool bIntEnable);
270 
271 //*****************************************************************************
272 //
284 //
285 //*****************************************************************************
286 extern uint32_t CRYPTOAesCbcStatus(void);
287 
288 //*****************************************************************************
289 //
316 //
317 //*****************************************************************************
318 extern uint32_t CRYPTOAesEcb(uint32_t *pui32MsgIn, uint32_t *pui32MsgOut,
319  uint32_t ui32KeyLocation, bool bEncrypt,
320  bool bIntEnable);
321 
322 //*****************************************************************************
323 //
335 //
336 //*****************************************************************************
337 extern uint32_t CRYPTOAesEcbStatus(void);
338 
339 //*****************************************************************************
340 //
349 //
350 //*****************************************************************************
351 __STATIC_INLINE void
353 {
354  //
355  // Result has already been copied to the output buffer by DMA.
356  // Disable master control/DMA clock and clear the operating mode.
357  //
358  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = 0x00000000;
359  HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) = 0x00000000;
360 }
361 
362 //*****************************************************************************
363 //
372 //
373 //*****************************************************************************
374 __STATIC_INLINE void
376 {
377  //
378  // Result has already been copied to the output buffer by DMA.
379  // Disable master control/DMA clock and clear the operating mode.
380  //
381  HWREG(CRYPTO_BASE + CRYPTO_O_ALGSEL) = 0x00000000;
382  HWREG(CRYPTO_BASE + CRYPTO_O_AESCTL) = 0x00000000;
383 }
384 
385 //*****************************************************************************
386 //
420 //
421 //*****************************************************************************
422 extern uint32_t CRYPTOCcmAuthEncrypt(bool bEncrypt, uint32_t ui32AuthLength,
423  uint32_t *pui32Nonce,
424  uint32_t *pui32PlainText,
425  uint32_t ui32PlainTextLength,
426  uint32_t *pui32Header,
427  uint32_t ui32HeaderLength,
428  uint32_t ui32KeyLocation,
429  uint32_t ui32FieldLength,
430  bool bIntEnable);
431 
432 //*****************************************************************************
433 //
445 //
446 //*****************************************************************************
447 extern uint32_t CRYPTOCcmAuthEncryptStatus(void);
448 
449 //*****************************************************************************
450 //
461 //
462 //*****************************************************************************
463 extern uint32_t CRYPTOCcmAuthEncryptResultGet(uint32_t ui32TagLength,
464  uint32_t *pui32CcmTag);
465 
466 //*****************************************************************************
467 //
499 //
500 //*****************************************************************************
501 extern uint32_t CRYPTOCcmInvAuthDecrypt(bool bDecrypt, uint32_t ui32AuthLength,
502  uint32_t *pui32Nonce,
503  uint32_t *pui32CipherText,
504  uint32_t ui32CipherTextLength,
505  uint32_t *pui32Header,
506  uint32_t ui32HeaderLength,
507  uint32_t ui32KeyLocation,
508  uint32_t ui32FieldLength,
509  bool bIntEnable);
510 
511 //*****************************************************************************
512 //
519 //
520 //*****************************************************************************
521 extern uint32_t CRYPTOCcmInvAuthDecryptStatus(void);
522 
523 //*****************************************************************************
524 //
534 //
535 //*****************************************************************************
536 extern uint32_t CRYPTOCcmInvAuthDecryptResultGet(uint32_t ui32AuthLength,
537  uint32_t *pui32CipherText,
538  uint32_t ui32CipherTextLength,
539  uint32_t *pui32CcmTag);
540 
541 //*****************************************************************************
542 //
555 //
556 //*****************************************************************************
557 __STATIC_INLINE uint32_t
559 {
560  //
561  // Return the value of the status register.
562  //
563  return (HWREG(CRYPTO_BASE + CRYPTO_O_DMASTAT));
564 }
565 
566 //*****************************************************************************
567 //
577 //
578 //*****************************************************************************
579 extern void CRYPTODmaEnable(uint32_t ui32Channels);
580 
581 //*****************************************************************************
582 //
592 //
593 //*****************************************************************************
594 extern void CRYPTODmaDisable(uint32_t ui32Channels);
595 
596 //*****************************************************************************
597 //
609 //
610 //*****************************************************************************
611 __STATIC_INLINE void
612 CRYPTOIntEnable(uint32_t ui32IntFlags)
613 {
614  //
615  // Check the arguments.
616  //
617  ASSERT((ui32IntFlags & CRYPTO_DMA_IN_DONE) |
618  (ui32IntFlags & CRYPTO_RESULT_RDY));
619 
620  //
621  // Using level interrupt.
622  //
624 
625  //
626  // Enable the specified interrupts.
627  //
628  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) |= ui32IntFlags;
629 }
630 
631 //*****************************************************************************
632 //
644 //
645 //*****************************************************************************
646 __STATIC_INLINE void
647 CRYPTOIntDisable(uint32_t ui32IntFlags)
648 {
649  //
650  // Check the arguments.
651  //
652  ASSERT((ui32IntFlags & CRYPTO_DMA_IN_DONE) |
653  (ui32IntFlags & CRYPTO_RESULT_RDY));
654 
655  //
656  // Disable the specified interrupts.
657  //
658  HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN) &= ~ui32IntFlags;
659 }
660 
661 //*****************************************************************************
662 //
676 //
677 //*****************************************************************************
678 __STATIC_INLINE uint32_t
679 CRYPTOIntStatus(bool bMasked)
680 {
681  uint32_t ui32Mask;
682 
683  //
684  // Return either the interrupt status or the raw interrupt status as
685  // requested.
686  //
687  if(bMasked)
688  {
689  ui32Mask = HWREG(CRYPTO_BASE + CRYPTO_O_IRQEN);
690  return(ui32Mask & HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT));
691  }
692  else
693  {
694  return(HWREG(CRYPTO_BASE + CRYPTO_O_IRQSTAT) & 0x00000003);
695  }
696 }
697 
698 //*****************************************************************************
699 //
726 //
727 //*****************************************************************************
728 __STATIC_INLINE void
729 CRYPTOIntClear(uint32_t ui32IntFlags)
730 {
731  //
732  // Check the arguments.
733  //
734  ASSERT((ui32IntFlags & CRYPTO_DMA_IN_DONE) |
735  (ui32IntFlags & CRYPTO_RESULT_RDY));
736 
737  //
738  // Clear the requested interrupt sources,
739  //
740  HWREG(CRYPTO_BASE + CRYPTO_O_IRQCLR) = ui32IntFlags;
741 }
742 
743 //*****************************************************************************
744 //
759 //
760 //*****************************************************************************
761 __STATIC_INLINE void
762 CRYPTOIntRegister(void (*pfnHandler)(void))
763 {
764  //
765  // Register the interrupt handler.
766  //
767  IntRegister(INT_CRYPTO_RESULT_AVAIL_IRQ, pfnHandler);
768 
769  //
770  // Enable the UART interrupt.
771  //
772  IntEnable(INT_CRYPTO_RESULT_AVAIL_IRQ);
773 }
774 
775 //*****************************************************************************
776 //
788 //
789 //*****************************************************************************
790 __STATIC_INLINE void
792 {
793  //
794  // Disable the interrupt.
795  //
796  IntDisable(INT_CRYPTO_RESULT_AVAIL_IRQ);
797 
798  //
799  // Unregister the interrupt handler.
800  //
801  IntUnregister(INT_CRYPTO_RESULT_AVAIL_IRQ);
802 }
803 
804 //*****************************************************************************
805 //
806 // Support for DriverLib in ROM:
807 // Redirect to implementation in ROM when available.
808 //
809 //*****************************************************************************
810 #if !defined(DRIVERLIB_NOROM) && !defined(DOXYGEN)
811  #include <driverlib/rom.h>
812  #ifdef ROM_CRYPTOAesLoadKey
813  #undef CRYPTOAesLoadKey
814  #define CRYPTOAesLoadKey ROM_CRYPTOAesLoadKey
815  #endif
816  #ifdef ROM_CRYPTOAesCbc
817  #undef CRYPTOAesCbc
818  #define CRYPTOAesCbc ROM_CRYPTOAesCbc
819  #endif
820  #ifdef ROM_CRYPTOAesCbcStatus
821  #undef CRYPTOAesCbcStatus
822  #define CRYPTOAesCbcStatus ROM_CRYPTOAesCbcStatus
823  #endif
824  #ifdef ROM_CRYPTOAesEcb
825  #undef CRYPTOAesEcb
826  #define CRYPTOAesEcb ROM_CRYPTOAesEcb
827  #endif
828  #ifdef ROM_CRYPTOAesEcbStatus
829  #undef CRYPTOAesEcbStatus
830  #define CRYPTOAesEcbStatus ROM_CRYPTOAesEcbStatus
831  #endif
832  #ifdef ROM_CRYPTOCcmAuthEncrypt
833  #undef CRYPTOCcmAuthEncrypt
834  #define CRYPTOCcmAuthEncrypt ROM_CRYPTOCcmAuthEncrypt
835  #endif
836  #ifdef ROM_CRYPTOCcmAuthEncryptStatus
837  #undef CRYPTOCcmAuthEncryptStatus
838  #define CRYPTOCcmAuthEncryptStatus ROM_CRYPTOCcmAuthEncryptStatus
839  #endif
840  #ifdef ROM_CRYPTOCcmAuthEncryptResultGet
841  #undef CRYPTOCcmAuthEncryptResultGet
842  #define CRYPTOCcmAuthEncryptResultGet ROM_CRYPTOCcmAuthEncryptResultGet
843  #endif
844  #ifdef ROM_CRYPTOCcmInvAuthDecrypt
845  #undef CRYPTOCcmInvAuthDecrypt
846  #define CRYPTOCcmInvAuthDecrypt ROM_CRYPTOCcmInvAuthDecrypt
847  #endif
848  #ifdef ROM_CRYPTOCcmInvAuthDecryptStatus
849  #undef CRYPTOCcmInvAuthDecryptStatus
850  #define CRYPTOCcmInvAuthDecryptStatus ROM_CRYPTOCcmInvAuthDecryptStatus
851  #endif
852  #ifdef ROM_CRYPTOCcmInvAuthDecryptResultGet
853  #undef CRYPTOCcmInvAuthDecryptResultGet
854  #define CRYPTOCcmInvAuthDecryptResultGet ROM_CRYPTOCcmInvAuthDecryptResultGet
855  #endif
856  #ifdef ROM_CRYPTODmaEnable
857  #undef CRYPTODmaEnable
858  #define CRYPTODmaEnable ROM_CRYPTODmaEnable
859  #endif
860  #ifdef ROM_CRYPTODmaDisable
861  #undef CRYPTODmaDisable
862  #define CRYPTODmaDisable ROM_CRYPTODmaDisable
863  #endif
864 #endif
865 
866 //*****************************************************************************
867 //
868 // Mark the end of the C bindings section for C++ compilers.
869 //
870 //*****************************************************************************
871 #ifdef __cplusplus
872 }
873 #endif
874 
875 #endif // __CRYPTO_H__
876 
877 //*****************************************************************************
878 //
882 //
883 //*****************************************************************************
static uint32_t CRYPTODmaStatus(void)
Get the current status of the Crypto DMA controller.
Definition: crypto.h:558
uint32_t CRYPTOCcmAuthEncryptStatus(void)
Check the result of an AES CCM operation.
Definition: crypto.c:754
#define CRYPTO_RESULT_RDY
Definition: crypto.h:115
static void CRYPTOIntClear(uint32_t ui32IntFlags)
Clears Crypto interrupt sources.
Definition: crypto.h:729
uint32_t CRYPTOAesCbc(uint32_t *pui32MsgIn, uint32_t *pui32MsgOut, uint32_t ui32MsgLength, uint32_t *pui32Nonce, uint32_t ui32KeyLocation, bool bEncrypt, bool bIntEnable)
Start an AES-CBC operation (encryption or decryption).
Definition: crypto.c:207
static void CRYPTOIntUnregister(void)
Unregisters an interrupt handler for a Crypto interrupt.
Definition: crypto.h:791
uint32_t CRYPTOCcmInvAuthDecrypt(bool bDecrypt, uint32_t ui32AuthLength, uint32_t *pui32Nonce, uint32_t *pui32CipherText, uint32_t ui32CipherTextLength, uint32_t *pui32Header, uint32_t ui32HeaderLength, uint32_t ui32KeyLocation, uint32_t ui32FieldLength, bool bIntEnable)
Start a CCM Decryption and Inverse Authentication operation.
Definition: crypto.c:842
static void CRYPTOIntEnable(uint32_t ui32IntFlags)
Enables individual Crypto interrupt sources.
Definition: crypto.h:612
uint32_t CRYPTOAesLoadKey(uint32_t *pui32AesKey, uint32_t ui32KeyLocation)
Write the key into the Key Ram.
Definition: crypto.c:90
static void CRYPTOAesCbcFinish(void)
Finish the encryption operation by resetting the operation mode.
Definition: crypto.h:375
uint32_t CRYPTOCcmAuthEncryptResultGet(uint32_t ui32TagLength, uint32_t *pui32CcmTag)
Get the result of an AES CCM operation.
Definition: crypto.c:793
#define CRYPTO_DMA_IN_DONE
Definition: crypto.h:114
uint32_t CRYPTOCcmInvAuthDecryptStatus(void)
Checks CCM decrypt and Inverse Authentication result.
Definition: crypto.c:1088
#define ASSERT(expr)
Definition: debug.h:74
static void CRYPTOIntRegister(void(*pfnHandler)(void))
Registers an interrupt handler for a Crypto interrupt.
Definition: crypto.h:762
static void CRYPTOIntDisable(uint32_t ui32IntFlags)
Disables individual CRYPTO interrupt sources.
Definition: crypto.h:647
uint32_t CRYPTOCcmInvAuthDecryptResultGet(uint32_t ui32AuthLength, uint32_t *pui32CipherText, uint32_t ui32CipherTextLength, uint32_t *pui32CcmTag)
Get the result of the CCM operation.
Definition: crypto.c:1127
uint32_t CRYPTOAesEcbStatus(void)
Check the result of an AES ECB operation.
Definition: crypto.c:471
static void CRYPTOAesEcbFinish(void)
Finish the encryption operation by resetting the operation mode.
Definition: crypto.h:352
void IntUnregister(uint32_t ui32Interrupt)
Unregisters the function to be called when an interrupt occurs.
Definition: interrupt.c:200
static uint32_t CRYPTOIntStatus(bool bMasked)
Gets the current interrupt status.
Definition: crypto.h:679
void CRYPTODmaDisable(uint32_t ui32Channels)
Disable Crypto DMA operation.
Definition: crypto.c:1223
uint32_t CRYPTOAesEcb(uint32_t *pui32MsgIn, uint32_t *pui32MsgOut, uint32_t ui32KeyLocation, bool bEncrypt, bool bIntEnable)
Start an AES-ECB operation (encryption or decryption).
Definition: crypto.c:351
void CRYPTODmaEnable(uint32_t ui32Channels)
Enable Crypto DMA operation.
Definition: crypto.c:1196
uint32_t CRYPTOAesCbcStatus(void)
Check the result of an AES CBC operation.
Definition: crypto.c:340
void IntDisable(uint32_t ui32Interrupt)
Disables an interrupt.
Definition: interrupt.c:378
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Registers a function to be called when an interrupt occurs.
Definition: interrupt.c:152
void IntEnable(uint32_t ui32Interrupt)
Enables an interrupt.
Definition: interrupt.c:318
uint32_t CRYPTOCcmAuthEncrypt(bool bEncrypt, uint32_t ui32AuthLength, uint32_t *pui32Nonce, uint32_t *pui32PlainText, uint32_t ui32PlainTextLength, uint32_t *pui32Header, uint32_t ui32HeaderLength, uint32_t ui32KeyLocation, uint32_t ui32FieldLength, bool bIntEnable)
Start CCM operation.
Definition: crypto.c:511