EE445M RTOS
Taken at the University of Texas Spring 2015
shamd5.c
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // shamd5.c - Driver for the SHA/MD5 module.
4 //
5 // Copyright (c) 2012-2014 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the
18 // distribution.
19 //
20 // Neither the name of Texas Instruments Incorporated nor the names of
21 // its contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 //
36 // This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 #include <stdbool.h>
41 #include <stdint.h>
42 #include "inc/hw_ints.h"
43 #include "inc/hw_memmap.h"
44 #include "inc/hw_nvic.h"
45 #include "inc/hw_shamd5.h"
46 #include "inc/hw_types.h"
47 #include "driverlib/debug.h"
48 #include "driverlib/interrupt.h"
49 #include "driverlib/shamd5.h"
50 
51 //*****************************************************************************
52 //
55 //
56 //*****************************************************************************
57 
58 //*****************************************************************************
59 //
68 //
69 //*****************************************************************************
70 void
71 SHAMD5Reset(uint32_t ui32Base)
72 {
73  //
74  // Check the arguments.
75  //
76  ASSERT(ui32Base == SHAMD5_BASE);
77 
78  //
79  // Set the soft-reset bit.
80  //
82 
83  //
84  // Wait for the reset to complete.
85  //
86  while((HWREG(ui32Base + SHAMD5_O_SYSSTATUS) &
88  {
89  }
90 
91  //
92  // Force idle mode.
93  //
94  HWREG(ui32Base + SHAMD5_O_SYSCONFIG) =
97 }
98 
99 //*****************************************************************************
100 //
108 //
109 //*****************************************************************************
110 void
111 SHAMD5DMAEnable(uint32_t ui32Base)
112 {
113  //
114  // Check the arguments.
115  //
116  ASSERT(ui32Base == SHAMD5_BASE);
117 
118  //
119  // Write the new configuration into the register.
120  //
121  HWREG(ui32Base + SHAMD5_O_SYSCONFIG) |=
123 }
124 
125 //*****************************************************************************
126 //
134 //
135 //*****************************************************************************
136 void
137 SHAMD5DMADisable(uint32_t ui32Base)
138 {
139  //
140  // Check the arguments.
141  //
142  ASSERT(ui32Base == SHAMD5_BASE);
143 
144  //
145  // Write the new configuration into the register.
146  //
147  HWREG(ui32Base + SHAMD5_O_SYSCONFIG) &=
149 }
150 
151 //*****************************************************************************
152 //
169 //
170 //*****************************************************************************
171 uint32_t
172 SHAMD5IntStatus(uint32_t ui32Base, bool bMasked)
173 {
174  uint32_t ui32Status, ui32Enable, ui32Temp;
175 
176  //
177  // Check the arguments.
178  //
179  ASSERT(ui32Base == SHAMD5_BASE);
180 
181  //
182  // Return the value of the IRQSTATUS register.
183  //
184  ui32Status = HWREG(ui32Base + SHAMD5_O_IRQSTATUS);
185  if(bMasked)
186  {
187  ui32Enable = HWREG(ui32Base + SHAMD5_O_IRQENABLE);
188  ui32Temp = HWREG(ui32Base + SHAMD5_O_DMAMIS);
189  return((ui32Status & ui32Enable) |
190  ((ui32Temp & 0x00000001) << 19) |
191  ((ui32Temp & 0x00000002) << 16) |
192  ((ui32Temp & 0x00000004) << 14));
193  }
194  else
195  {
196  ui32Temp = HWREG(ui32Base + SHAMD5_O_DMARIS);
197  return(ui32Status |
198  ((ui32Temp & 0x00000001) << 19) |
199  ((ui32Temp & 0x00000002) << 16) |
200  ((ui32Temp & 0x00000004) << 14));
201  }
202 }
203 
204 //*****************************************************************************
205 //
222 //
223 //*****************************************************************************
224 void
225 SHAMD5IntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
226 {
227  //
228  // Check the arguments.
229  //
230  ASSERT(ui32Base == SHAMD5_BASE);
231  ASSERT((ui32IntFlags == SHAMD5_INT_CONTEXT_READY) ||
232  (ui32IntFlags == SHAMD5_INT_PARTHASH_READY) ||
233  (ui32IntFlags == SHAMD5_INT_INPUT_READY) ||
234  (ui32IntFlags == SHAMD5_INT_OUTPUT_READY));
235 
236  //
237  // Enable the interrupt sources.
238  //
239  HWREG(ui32Base + SHAMD5_O_DMAIM) |= (((ui32IntFlags & 0x00010000) >> 14) |
240  ((ui32IntFlags & 0x00020000) >> 16) |
241  ((ui32IntFlags & 0x00040000) >> 19));
242  HWREG(ui32Base + SHAMD5_O_IRQENABLE) |= ui32IntFlags & 0x0000ffff;
243 
244  //
245  // Enable all interrupts.
246  //
248 }
249 
250 //*****************************************************************************
251 //
267 //
268 //*****************************************************************************
269 void
270 SHAMD5IntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
271 {
272  //
273  // Check the arguments.
274  //
275  ASSERT(ui32Base == SHAMD5_BASE);
276  ASSERT((ui32IntFlags == SHAMD5_INT_CONTEXT_READY) ||
277  (ui32IntFlags == SHAMD5_INT_PARTHASH_READY) ||
278  (ui32IntFlags == SHAMD5_INT_INPUT_READY) ||
279  (ui32IntFlags == SHAMD5_INT_OUTPUT_READY));
280 
281  //
282  // Clear the corresponding flags disabling the interrupt sources.
283  //
284  HWREG(ui32Base + SHAMD5_O_DMAIM) &= ~(((ui32IntFlags & 0x00010000) >> 14) |
285  ((ui32IntFlags & 0x00020000) >> 16) |
286  ((ui32IntFlags & 0x00040000) >> 19));
287  HWREG(ui32Base + SHAMD5_O_IRQENABLE) &= ~(ui32IntFlags & 0x0000ffff);
288 
289  //
290  // If there are no interrupts enabled, then disable all interrupts.
291  //
292  if(HWREG(ui32Base + SHAMD5_O_IRQENABLE) == 0x0)
293  {
295  }
296 }
297 
298 //*****************************************************************************
299 //
315 //
316 //*****************************************************************************
317 void
318 SHAMD5IntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
319 {
320  //
321  // Check the arguments.
322  //
323  ASSERT(ui32Base == SHAMD5_BASE);
324  ASSERT((ui32IntFlags == SHAMD5_INT_CONTEXT_READY) ||
325  (ui32IntFlags == SHAMD5_INT_PARTHASH_READY) ||
326  (ui32IntFlags == SHAMD5_INT_INPUT_READY) ||
327  (ui32IntFlags == SHAMD5_INT_OUTPUT_READY));
328 
329  //
330  // Clear the corresponding flags disabling the interrupt sources.
331  //
332  HWREG(ui32Base + SHAMD5_O_DMAIC) = (((ui32IntFlags & 0x00010000) >> 14) |
333  ((ui32IntFlags & 0x00020000) >> 16) |
334  ((ui32IntFlags & 0x00040000) >> 19));
335 }
336 
337 //*****************************************************************************
338 //
360 //
361 //*****************************************************************************
362 void
363 SHAMD5IntRegister(uint32_t ui32Base, void (*pfnHandler)(void))
364 {
365  //
366  // Check the arguments.
367  //
368  ASSERT(ui32Base == SHAMD5_BASE);
369 
370  //
371  // Register the interrupt handler.
372  //
373  IntRegister(INT_SHA0_TM4C129, pfnHandler);
374 
375  //
376  // Enable the interrupt
377  //
379 }
380 
381 //*****************************************************************************
382 //
394 //
395 //*****************************************************************************
396 void
397 SHAMD5IntUnregister(uint32_t ui32Base)
398 {
399  //
400  // Check the arguments.
401  //
402  ASSERT(ui32Base == SHAMD5_BASE);
403 
404  //
405  // Disable the interrupt.
406  //
408 
409  //
410  // Unregister the interrupt handler.
411  //
413 }
414 
415 //*****************************************************************************
416 //
429 //
430 //*****************************************************************************
431 void
432 SHAMD5HashLengthSet(uint32_t ui32Base, uint32_t ui32Length)
433 {
434  //
435  // Check the arguments.
436  //
437  ASSERT(ui32Base == SHAMD5_BASE);
438 
439  //
440  // Set the LENGTH register and start processing.
441  //
442  HWREG(ui32Base + SHAMD5_O_LENGTH) = ui32Length;
443 }
444 
445 //*****************************************************************************
446 //
466 //
467 //*****************************************************************************
468 void
469 SHAMD5ConfigSet(uint32_t ui32Base, uint32_t ui32Mode)
470 {
471  //
472  // Check the arguments.
473  //
474  ASSERT(ui32Base == SHAMD5_BASE);
475  ASSERT((ui32Mode == SHAMD5_ALGO_MD5) ||
476  (ui32Mode == SHAMD5_ALGO_SHA1) ||
477  (ui32Mode == SHAMD5_ALGO_SHA224) ||
478  (ui32Mode == SHAMD5_ALGO_SHA256) ||
479  (ui32Mode == SHAMD5_ALGO_HMAC_MD5) ||
480  (ui32Mode == SHAMD5_ALGO_HMAC_SHA1) ||
481  (ui32Mode == SHAMD5_ALGO_HMAC_SHA224) ||
482  (ui32Mode == SHAMD5_ALGO_HMAC_SHA256));
483 
484  //
485  // Write the value in the MODE register.
486  //
487  HWREG(ui32Base + SHAMD5_O_MODE) = ui32Mode;
488 }
489 
490 //*****************************************************************************
491 //
503 //
504 //*****************************************************************************
505 bool
506 SHAMD5DataWriteNonBlocking(uint32_t ui32Base, uint32_t *pui32Src)
507 {
508  uint32_t ui32Counter;
509 
510  //
511  // Check the arguments.
512  //
513  ASSERT(ui32Base == SHAMD5_BASE);
514 
515  //
516  // Check that the SHA/MD5 module is ready for data. If not, return false.
517  //
518  if((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_INPUT_READY) == 0)
519  {
520  return(false);
521  }
522 
523  //
524  // Write the 16 words of data.
525  //
526  for(ui32Counter = 0; ui32Counter < 64; ui32Counter += 4)
527  {
528  HWREG(ui32Base + SHAMD5_O_DATA_0_IN + ui32Counter) = *pui32Src++;
529  }
530 
531  //
532  // Return true as a sign of successfully completing the function.
533  //
534  return(true);
535 }
536 
537 //*****************************************************************************
538 //
549 //
550 //*****************************************************************************
551 void
552 SHAMD5DataWrite(uint32_t ui32Base, uint32_t *pui32Src)
553 {
554  uint32_t ui32Counter;
555 
556  //
557  // Check the arguments.
558  //
559  ASSERT(ui32Base == SHAMD5_BASE);
560 
561  //
562  // Wait for the module to be ready to accept data.
563  //
564  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_INPUT_READY) == 0)
565  {
566  }
567 
568  //
569  // Write the 16 words of data.
570  //
571  for(ui32Counter = 0; ui32Counter < 64; ui32Counter += 4)
572  {
573  HWREG(ui32Base + SHAMD5_O_DATA_0_IN + ui32Counter) = *pui32Src++;
574  }
575 }
576 
577 //*****************************************************************************
578 //
589 //
590 //*****************************************************************************
591 void
592 SHAMD5ResultRead(uint32_t ui32Base, uint32_t *pui32Dest)
593 {
594  uint32_t ui32Idx, ui32Count;
595 
596  //
597  // Check the arguments.
598  //
599  ASSERT(ui32Base == SHAMD5_BASE);
600 
601  //
602  // Determine the number of bytes in the result, based on the hash type.
603  //
604  switch(HWREG(ui32Base + SHAMD5_O_MODE) & SHAMD5_MODE_ALGO_M)
605  {
606  //
607  // The MD5 hash is being used.
608  //
610  {
611  //
612  // There are 16 bytes in the MD5 hash.
613  //
614  ui32Count = 16;
615 
616  //
617  // Done.
618  //
619  break;
620  }
621 
622  //
623  // The SHA-1 hash is being used.
624  //
626  {
627  //
628  // There are 20 bytes in the SHA-1 hash.
629  //
630  ui32Count = 20;
631 
632  //
633  // Done.
634  //
635  break;
636  }
637 
638  //
639  // The SHA-224 hash is being used.
640  //
642  {
643  //
644  // There are 28 bytes in the SHA-224 hash.
645  //
646  ui32Count = 28;
647 
648  //
649  // Done.
650  //
651  break;
652  }
653 
654  //
655  // The SHA-256 hash is being used.
656  //
658  {
659  //
660  // There are 32 bytes in the SHA-256 hash.
661  //
662  ui32Count = 32;
663 
664  //
665  // Done.
666  //
667  break;
668  }
669 
670  //
671  // The hash type is not recognized.
672  //
673  default:
674  {
675  //
676  // Return without reading a result since the hardware appears to be
677  // misconfigured.
678  //
679  return;
680  }
681  }
682 
683  //
684  // Read the hash result.
685  //
686  for(ui32Idx = 0; ui32Idx < ui32Count; ui32Idx += 4)
687  {
688  *pui32Dest++ = HWREG(ui32Base + SHAMD5_O_IDIGEST_A + ui32Idx);
689  }
690 }
691 
692 //*****************************************************************************
693 //
709 //
710 //*****************************************************************************
711 static void
712 _SHAMD5DataWriteMultiple(uint32_t ui32Base, uint32_t *pui32DataSrc,
713  uint32_t ui32DataLength)
714 {
715  uint32_t ui32Idx, ui32Count;
716 
717  //
718  // Check the arguments.
719  //
720  ASSERT(ui32Base == SHAMD5_BASE);
721 
722  //
723  // Calculate the number of blocks of data.
724  //
725  ui32Count = ui32DataLength / 64;
726 
727  //
728  // Loop through all the blocks and write them into the data registers
729  // making sure to block additional operations until we can write the
730  // next 16 words.
731  //
732  for(ui32Idx = 0; ui32Idx < ui32Count; ui32Idx++)
733  {
734  //
735  // Write the block of data.
736  //
737  SHAMD5DataWrite(ui32Base, pui32DataSrc);
738 
739  //
740  // Increment the pointer to next block of data.
741  //
742  pui32DataSrc += 16;
743  }
744 
745  //
746  // Calculate the remaining bytes of data that don't make up a full block.
747  //
748  ui32Count = ui32DataLength % 64;
749 
750  //
751  // If there are bytes that do not make up a whole block, then
752  // write them separately.
753  //
754  if(ui32Count)
755  {
756  //
757  // Wait until the engine has finished processing the previous block.
758  //
759  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) &
761  {
762  }
763 
764  //
765  // Loop through the remaining words.
766  //
767  for(ui32Idx = 0; ui32Idx < ui32Count; ui32Idx += 4)
768  {
769  //
770  // Write the word into the data register.
771  //
772  HWREG(ui32Base + SHAMD5_O_DATA_0_IN + ui32Idx) = *pui32DataSrc++;
773  }
774  }
775 }
776 
777 //*****************************************************************************
778 //
805 //
806 //*****************************************************************************
807 void
808 SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc,
809  uint32_t ui32DataLength, uint32_t *pui32HashResult)
810 {
811  //
812  // Check the arguments.
813  //
814  ASSERT(ui32Base == SHAMD5_BASE);
815  ASSERT((ui32DataLength % 64) == 0);
816 
817  //
818  // Wait for the context to be ready before writing the mode.
819  //
820  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_CONTEXT_READY) ==
821  0)
822  {
823  }
824 
825  //
826  // Write the length.
827  //
828  SHAMD5HashLengthSet(ui32Base, ui32DataLength);
829 
830  //
831  // Write the data.
832  //
833  _SHAMD5DataWriteMultiple(ui32Base, pui32DataSrc, ui32DataLength);
834 
835  //
836  // Wait for the output to be ready.
837  //
838  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_OUTPUT_READY) ==
839  0)
840  {
841  }
842 
843  //
844  // Read the result.
845  //
846  SHAMD5ResultRead(ui32Base, pui32HashResult);
847 }
848 
849 //*****************************************************************************
850 //
878 //
879 //*****************************************************************************
880 void
881 SHAMD5HMACProcess(uint32_t ui32Base, uint32_t *pui32DataSrc,
882  uint32_t ui32DataLength, uint32_t *pui32HashResult)
883 {
884  //
885  // Check the arguments.
886  //
887  ASSERT(ui32Base == SHAMD5_BASE);
888 
889  //
890  // Wait for the context to be ready before writing the mode.
891  //
892  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_CONTEXT_READY) ==
893  0)
894  {
895  }
896 
897  //
898  // Write the length.
899  //
900  SHAMD5HashLengthSet(ui32Base, ui32DataLength);
901 
902  //
903  // Write the data in the registers.
904  //
905  _SHAMD5DataWriteMultiple(ui32Base, pui32DataSrc, ui32DataLength);
906 
907  //
908  // Wait for the output to be ready.
909  //
910  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_OUTPUT_READY) ==
911  0)
912  {
913  }
914 
915  //
916  // Read the result.
917  //
918  SHAMD5ResultRead(ui32Base, pui32HashResult);
919 }
920 
921 //*****************************************************************************
922 //
940 //
941 //*****************************************************************************
942 void
943 SHAMD5HMACPPKeyGenerate(uint32_t ui32Base, uint32_t *pui32Key,
944  uint32_t *pui32PPKey)
945 {
946  uint32_t ui32Index;
947 
948  //
949  // Check the arguments.
950  //
951  ASSERT(ui32Base == SHAMD5_BASE);
952 
953  //
954  // Wait for the context to be ready before writing the mode.
955  //
956  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_CONTEXT_READY) ==
957  0)
958  {
959  }
960 
961  //
962  // Write the HMAC key.
963  //
964  for(ui32Index = 0; ui32Index < 64; ui32Index += 4)
965  {
966  HWREG(ui32Base + SHAMD5_O_ODIGEST_A + ui32Index) = *pui32Key++;
967  }
968 
969  //
970  // Set the flag to cause the HMAC key to be pre-processed.
971  //
973 
974  //
975  // Set the length to zero to start the HMAC key pre-processing.
976  //
977  HWREG(ui32Base + SHAMD5_O_LENGTH) = 0;
978 
979  //
980  // Wait for key to be processed.
981  //
982  while((HWREG(ui32Base + SHAMD5_O_IRQSTATUS) & SHAMD5_INT_OUTPUT_READY) ==
983  0)
984  {
985  }
986 
987  //
988  // Read the pre-processed key from the SHA/MD5 module.
989  //
990  for(ui32Index = 0; ui32Index < 64; ui32Index += 4)
991  {
992  *pui32PPKey++ = HWREG(ui32Base + SHAMD5_O_ODIGEST_A + ui32Index);
993  }
994 }
995 
996 //*****************************************************************************
997 //
1011 //
1012 //*****************************************************************************
1013 void
1014 SHAMD5HMACKeySet(uint32_t ui32Base, uint32_t *pui32Src)
1015 {
1016  uint32_t ui32Idx;
1017 
1018  //
1019  // Check the arguments.
1020  //
1021  ASSERT(ui32Base == SHAMD5_BASE);
1022 
1023  //
1024  // Write the key to the digest registers.
1025  //
1026  for(ui32Idx = 0; ui32Idx < 64; ui32Idx += 4)
1027  {
1028  HWREG(ui32Base + SHAMD5_O_ODIGEST_A + ui32Idx) = *pui32Src++;
1029  }
1030 
1031  //
1032  // Configure the SHA engine for HMAC operation.
1033  //
1037 }
1038 
1039 //*****************************************************************************
1040 //
1055 //
1056 //*****************************************************************************
1057 void
1058 SHAMD5HMACPPKeySet(uint32_t ui32Base, uint32_t *pui32Src)
1059 {
1060  uint32_t ui32Idx;
1061 
1062  //
1063  // Check the arguments.
1064  //
1065  ASSERT(ui32Base == SHAMD5_BASE);
1066 
1067  //
1068  // Write the key to the digest registers.
1069  //
1070  for(ui32Idx = 0; ui32Idx < 64; ui32Idx += 4)
1071  {
1072  HWREG(ui32Base + SHAMD5_O_ODIGEST_A + ui32Idx) = *pui32Src++;
1073  }
1074 
1075  //
1076  // Configure the SHA engine to continue the HMAC.
1077  //
1080 
1081  //
1082  // Write the digest count to 64 to account for the preprocessed key.
1083  //
1084  HWREG(ui32Base + SHAMD5_O_DIGEST_COUNT) = 64;
1085 }
1086 
1087 //*****************************************************************************
1088 //
1089 // Close the Doxygen group.
1091 //
1092 //*****************************************************************************
#define SHAMD5_BASE
Definition: hw_memmap.h:139
#define SHAMD5_O_IRQENABLE
Definition: hw_shamd5.h:87
#define SHAMD5_SYSCONFIG_DMA_EN
Definition: hw_shamd5.h:460
#define SHAMD5_ALGO_HMAC_MD5
Definition: shamd5.h:64
#define SHAMD5_O_DMAIM
Definition: hw_shamd5.h:88
#define SHAMD5_O_DMARIS
Definition: hw_shamd5.h:89
void SHAMD5IntDisable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: shamd5.c:270
#define SHAMD5_O_DMAMIS
Definition: hw_shamd5.h:90
void SHAMD5IntEnable(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: shamd5.c:225
#define SHAMD5_ALGO_SHA224
Definition: shamd5.h:62
#define SHAMD5_ALGO_SHA1
Definition: shamd5.h:61
#define HWREG(x)
Definition: hw_types.h:48
void SHAMD5ResultRead(uint32_t ui32Base, uint32_t *pui32Dest)
Definition: shamd5.c:592
void SHAMD5HMACPPKeyGenerate(uint32_t ui32Base, uint32_t *pui32Key, uint32_t *pui32PPKey)
Definition: shamd5.c:943
#define SHAMD5_O_IRQSTATUS
Definition: hw_shamd5.h:86
#define SHAMD5_INT_OUTPUT_READY
Definition: shamd5.h:81
bool SHAMD5DataWriteNonBlocking(uint32_t ui32Base, uint32_t *pui32Src)
Definition: shamd5.c:506
#define ASSERT(expr)
Definition: debug.h:67
#define SHAMD5_SYSCONFIG_SIDLE_M
Definition: hw_shamd5.h:456
#define SHAMD5_ALGO_MD5
Definition: shamd5.h:60
#define SHAMD5_O_DMAIC
Definition: hw_shamd5.h:91
void SHAMD5HMACKeySet(uint32_t ui32Base, uint32_t *pui32Src)
Definition: shamd5.c:1014
void SHAMD5DMADisable(uint32_t ui32Base)
Definition: shamd5.c:137
void SHAMD5IntRegister(uint32_t ui32Base, void(*pfnHandler)(void))
Definition: shamd5.c:363
#define SHAMD5_O_DIGEST_COUNT
Definition: hw_shamd5.h:64
void SHAMD5HMACPPKeySet(uint32_t ui32Base, uint32_t *pui32Src)
Definition: shamd5.c:1058
void SHAMD5HashLengthSet(uint32_t ui32Base, uint32_t ui32Length)
Definition: shamd5.c:432
#define SHAMD5_ALGO_HMAC_SHA1
Definition: shamd5.h:65
#define SHAMD5_SYSSTATUS_RESETDONE
Definition: hw_shamd5.h:471
#define SHAMD5_O_DATA_0_IN
Definition: hw_shamd5.h:67
#define SHAMD5_ALGO_SHA256
Definition: shamd5.h:63
#define SHAMD5_ALGO_HMAC_SHA256
Definition: shamd5.h:67
#define SHAMD5_O_IDIGEST_A
Definition: hw_shamd5.h:56
#define SHAMD5_O_ODIGEST_A
Definition: hw_shamd5.h:48
#define SHAMD5_INT_INPUT_READY
Definition: shamd5.h:80
#define SHAMD5_SYSCONFIG_SOFTRESET
Definition: hw_shamd5.h:462
#define SHAMD5_MODE_CLOSE_HASH
Definition: hw_shamd5.h:256
#define INT_SHA0_TM4C129
Definition: hw_ints.h:268
#define SHAMD5_MODE_HMAC_KEY_PROC
Definition: hw_shamd5.h:254
#define SHAMD5_O_LENGTH
Definition: hw_shamd5.h:66
#define SHAMD5_O_MODE
Definition: hw_shamd5.h:65
#define SHAMD5_MODE_ALGO_SHA1
Definition: hw_shamd5.h:269
uint32_t SHAMD5IntStatus(uint32_t ui32Base, bool bMasked)
Definition: shamd5.c:172
void SHAMD5DataProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult)
Definition: shamd5.c:808
void SHAMD5ConfigSet(uint32_t ui32Base, uint32_t ui32Mode)
Definition: shamd5.c:469
void SHAMD5IntClear(uint32_t ui32Base, uint32_t ui32IntFlags)
Definition: shamd5.c:318
#define SHAMD5_O_SYSCONFIG
Definition: hw_shamd5.h:84
#define SHAMD5_O_SYSSTATUS
Definition: hw_shamd5.h:85
#define SHAMD5_SYSCONFIG_SIDLE_FORCE
Definition: hw_shamd5.h:458
#define SHAMD5_MODE_ALGO_MD5
Definition: hw_shamd5.h:268
#define SHAMD5_INT_PARTHASH_READY
Definition: shamd5.h:78
void SHAMD5DMAEnable(uint32_t ui32Base)
Definition: shamd5.c:111
#define SHAMD5_SYSCONFIG_SADVANCED
Definition: hw_shamd5.h:454
static void _SHAMD5DataWriteMultiple(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength)
Definition: shamd5.c:712
void IntUnregister(uint32_t ui32Interrupt)
Definition: interrupt.c:381
#define SHAMD5_MODE_HMAC_OUTER_HASH
Definition: hw_shamd5.h:251
void SHAMD5HMACProcess(uint32_t ui32Base, uint32_t *pui32DataSrc, uint32_t ui32DataLength, uint32_t *pui32HashResult)
Definition: shamd5.c:881
#define SHAMD5_MODE_ALGO_SHA224
Definition: hw_shamd5.h:270
#define SHAMD5_ALGO_HMAC_SHA224
Definition: shamd5.h:66
void SHAMD5Reset(uint32_t ui32Base)
Definition: shamd5.c:71
#define SHAMD5_MODE_ALGO_SHA256
Definition: hw_shamd5.h:271
#define SHAMD5_MODE_ALGO_M
Definition: hw_shamd5.h:267
void SHAMD5DataWrite(uint32_t ui32Base, uint32_t *pui32Src)
Definition: shamd5.c:552
#define SHAMD5_INT_CONTEXT_READY
Definition: shamd5.h:76
void IntDisable(uint32_t ui32Interrupt)
Definition: interrupt.c:684
void IntRegister(uint32_t ui32Interrupt, void(*pfnHandler)(void))
Definition: interrupt.c:309
void IntEnable(uint32_t ui32Interrupt)
Definition: interrupt.c:610
void SHAMD5IntUnregister(uint32_t ui32Base)
Definition: shamd5.c:397
#define SHAMD5_SYSCONFIG_IT_EN
Definition: hw_shamd5.h:461