Lines Matching refs:Init

453   assert_param(IS_CRYP_KEYSIZE(hcryp->Init.KeySize));  in HAL_CRYP_Init()
454 assert_param(IS_CRYP_DATATYPE(hcryp->Init.DataType)); in HAL_CRYP_Init()
455 assert_param(IS_CRYP_ALGORITHM(hcryp->Init.Algorithm)); in HAL_CRYP_Init()
456 assert_param(IS_CRYP_INIT(hcryp->Init.KeyIVConfigSkip)); in HAL_CRYP_Init()
490 …cr_value = (uint32_t)(hcryp->Init.DataType | hcryp->Init.KeySize | hcryp->Init.Algorithm | hcryp-> in HAL_CRYP_Init()
524 cr_value = (uint32_t)(hcryp->Init.KeyMode | hcryp->Init.DataType | hcryp->Init.KeySize | \ in HAL_CRYP_Init()
525 … hcryp->Init.Algorithm | hcryp->Init.KeySelect | hcryp->Init.KeyProtection); in HAL_CRYP_Init()
623 hcryp->Init.DataType = pConf->DataType; in HAL_CRYP_SetConfig()
624 hcryp->Init.pKey = pConf->pKey; in HAL_CRYP_SetConfig()
625 hcryp->Init.Algorithm = pConf->Algorithm; in HAL_CRYP_SetConfig()
626 hcryp->Init.KeySize = pConf->KeySize; in HAL_CRYP_SetConfig()
627 hcryp->Init.pInitVect = pConf->pInitVect; in HAL_CRYP_SetConfig()
628 hcryp->Init.Header = pConf->Header; in HAL_CRYP_SetConfig()
629 hcryp->Init.HeaderSize = pConf->HeaderSize; in HAL_CRYP_SetConfig()
630 hcryp->Init.B0 = pConf->B0; in HAL_CRYP_SetConfig()
631 hcryp->Init.DataWidthUnit = pConf->DataWidthUnit; in HAL_CRYP_SetConfig()
632 hcryp->Init.KeyMode = pConf->KeyMode; in HAL_CRYP_SetConfig()
633 hcryp->Init.HeaderWidthUnit = pConf->HeaderWidthUnit; in HAL_CRYP_SetConfig()
634 hcryp->Init.KeyIVConfigSkip = pConf->KeyIVConfigSkip; in HAL_CRYP_SetConfig()
640 … hcryp->Init.DataType | hcryp->Init.KeySize | hcryp->Init.Algorithm | hcryp->Init.KeyMode); in HAL_CRYP_SetConfig()
644 hcryp->Init.KeySelect = pConf->KeySelect; in HAL_CRYP_SetConfig()
645 hcryp->Init.KeyProtection = pConf->KeyProtection; in HAL_CRYP_SetConfig()
648 …if ((hcryp->Init.KeySelect != CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_WRAPPED)) in HAL_CRYP_SetConfig()
658 … AES_CR_KEYSEL | AES_CR_KEYPROT | AES_CR_KMOD, hcryp->Init.DataType | hcryp->Init.KeySize | \ in HAL_CRYP_SetConfig()
659 … hcryp->Init.Algorithm | hcryp->Init.KeySelect | hcryp->Init.KeyProtection | hcryp->Init.KeyMode); in HAL_CRYP_SetConfig()
708 pConf->DataType = hcryp->Init.DataType; in HAL_CRYP_GetConfig()
709 pConf->pKey = hcryp->Init.pKey; in HAL_CRYP_GetConfig()
710 pConf->Algorithm = hcryp->Init.Algorithm; in HAL_CRYP_GetConfig()
711 pConf->KeySize = hcryp->Init.KeySize; in HAL_CRYP_GetConfig()
712 pConf->pInitVect = hcryp->Init.pInitVect; in HAL_CRYP_GetConfig()
713 pConf->Header = hcryp->Init.Header; in HAL_CRYP_GetConfig()
714 pConf->HeaderSize = hcryp->Init.HeaderSize; in HAL_CRYP_GetConfig()
715 pConf->B0 = hcryp->Init.B0; in HAL_CRYP_GetConfig()
716 pConf->DataWidthUnit = hcryp->Init.DataWidthUnit; in HAL_CRYP_GetConfig()
717 pConf->KeyMode = hcryp->Init.KeyMode; in HAL_CRYP_GetConfig()
718 pConf->KeySelect = hcryp->Init.KeySelect; in HAL_CRYP_GetConfig()
719 pConf->KeyProtection = hcryp->Init.KeyProtection; in HAL_CRYP_GetConfig()
720 pConf->KeyIVConfigSkip = hcryp->Init.KeyIVConfigSkip; in HAL_CRYP_GetConfig()
721 pConf->HeaderWidthUnit = hcryp->Init.HeaderWidthUnit; in HAL_CRYP_GetConfig()
993 if ((hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC) || \ in HAL_CRYP_Suspend()
994 (hcryp->Init.Algorithm == CRYP_AES_CCM)) in HAL_CRYP_Suspend()
999 CRYP_Read_KeyRegisters(hcryp, hcryp->Key_saved, hcryp->Init.KeySize); in HAL_CRYP_Suspend()
1007 hcryp->Init_saved = hcryp->Init; in HAL_CRYP_Suspend()
1014 hcryp->Size_saved = ((hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD)\ in HAL_CRYP_Suspend()
1020 if ((hcryp->Init.Algorithm == CRYP_AES_CBC) || \ in HAL_CRYP_Suspend()
1021 (hcryp->Init.Algorithm == CRYP_AES_CTR)) in HAL_CRYP_Suspend()
1057 hcryp->Init = hcryp->Init_saved; in HAL_CRYP_Resume()
1066 if ((hcryp->Init.Algorithm == CRYP_AES_CBC) || \ in HAL_CRYP_Resume()
1067 (hcryp->Init.Algorithm == CRYP_AES_CTR)) in HAL_CRYP_Resume()
1069 hcryp->Init.pInitVect = hcryp->IV_saved; in HAL_CRYP_Resume()
1088 CRYP_Write_KeyRegisters(hcryp, hcryp->Key_saved, hcryp->Init.KeySize); in HAL_CRYP_Resume()
1139 pcont->DataType = (uint32_t)(hcryp->Init.DataType); in HAL_CRYP_SaveContext()
1140 pcont->KeySize = (uint32_t)(hcryp->Init.KeySize); in HAL_CRYP_SaveContext()
1141 pcont->pKey = hcryp->Init.pKey; in HAL_CRYP_SaveContext()
1142 pcont->pInitVect = hcryp->Init.pInitVect; in HAL_CRYP_SaveContext()
1143 pcont->Algorithm = (uint32_t)(hcryp->Init.Algorithm); in HAL_CRYP_SaveContext()
1144 pcont->DataWidthUnit = (uint32_t)(hcryp->Init.DataWidthUnit); in HAL_CRYP_SaveContext()
1145 pcont->KeyIVConfigSkip = (uint32_t)(hcryp->Init.KeyIVConfigSkip); in HAL_CRYP_SaveContext()
1146 pcont->KeyMode = (uint32_t)(hcryp->Init.KeyMode); in HAL_CRYP_SaveContext()
1157 if ((hcryp->Init.Algorithm == CRYP_AES_CBC) || \ in HAL_CRYP_SaveContext()
1158 (hcryp->Init.Algorithm == CRYP_AES_CTR)) in HAL_CRYP_SaveContext()
1199 hcryp->Init.DataType = pcont->DataType; in HAL_CRYP_RestoreContext()
1200 hcryp->Init.KeySize = pcont->KeySize; in HAL_CRYP_RestoreContext()
1201 hcryp->Init.pKey = pcont->pKey; in HAL_CRYP_RestoreContext()
1202 hcryp->Init.pInitVect = pcont->pInitVect; in HAL_CRYP_RestoreContext()
1203 hcryp->Init.Algorithm = pcont->Algorithm; in HAL_CRYP_RestoreContext()
1204 hcryp->Init.DataWidthUnit = pcont->DataWidthUnit; in HAL_CRYP_RestoreContext()
1205 hcryp->Init.KeyIVConfigSkip = pcont->KeyIVConfigSkip; in HAL_CRYP_RestoreContext()
1206 hcryp->Init.KeyMode = pcont->KeyMode; in HAL_CRYP_RestoreContext()
1216 if ((hcryp->Init.Algorithm == CRYP_AES_CBC) || \ in HAL_CRYP_RestoreContext()
1217 (hcryp->Init.Algorithm == CRYP_AES_CTR)) in HAL_CRYP_RestoreContext()
1355 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Encrypt()
1371 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Encrypt()
1453 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Decrypt()
1469 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Decrypt()
1543 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Encrypt_IT()
1579 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Encrypt_IT()
1647 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Decrypt_IT()
1682 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Decrypt_IT()
1751 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Encrypt_DMA()
1767 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Encrypt_DMA()
1787 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in HAL_CRYP_Encrypt_DMA()
1804 if ((dokeyivconfig == 1U) && (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG)) in HAL_CRYP_Encrypt_DMA()
1809 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in HAL_CRYP_Encrypt_DMA()
1811 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in HAL_CRYP_Encrypt_DMA()
1821 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in HAL_CRYP_Encrypt_DMA()
1824 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in HAL_CRYP_Encrypt_DMA()
1845 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in HAL_CRYP_Encrypt_DMA()
1852 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYNOCONFIG) in HAL_CRYP_Encrypt_DMA()
1854 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in HAL_CRYP_Encrypt_DMA()
1912 assert_param(IS_CRYP_BUFFERSIZE(algo_assert, hcryp->Init.DataWidthUnit, Size)); in HAL_CRYP_Decrypt_DMA()
1929 if (hcryp->Init.DataWidthUnit == CRYP_DATAWIDTHUNIT_WORD) in HAL_CRYP_Decrypt_DMA()
2043 if ((hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC) || (hcryp->Init.Algorithm == CRYP_AES_CCM)) in HAL_CRYP_IRQHandler()
2158 …if ((hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) || (hcryp->Init.KeyIVConfigSkip == CRYP… in CRYP_AES_Encrypt()
2177 if ((hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) || \ in CRYP_AES_Encrypt()
2178 (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ALWAYS)) in CRYP_AES_Encrypt()
2183 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Encrypt()
2185 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt()
2195 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Encrypt()
2198 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt()
2222 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Encrypt()
2229 if (hcryp->Init.KeyIVConfigSkip == CRYP_IVCONFIG_ONCE) in CRYP_AES_Encrypt()
2232 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt()
2233 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Encrypt()
2243 if (hcryp->Init.KeyIVConfigSkip == CRYP_IVCONFIG_ONCE) in CRYP_AES_Encrypt()
2246 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt()
2250 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYNOCONFIG) in CRYP_AES_Encrypt()
2252 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Encrypt()
2295 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AES_Encrypt_IT()
2312 if ((dokeyivconfig == 1U) && (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG)) in CRYP_AES_Encrypt_IT()
2317 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Encrypt_IT()
2319 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt_IT()
2329 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Encrypt_IT()
2332 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Encrypt_IT()
2352 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Encrypt_IT()
2359 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYNOCONFIG) in CRYP_AES_Encrypt_IT()
2361 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Encrypt_IT()
2411 …if ((hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) || (hcryp->Init.KeyIVConfigSkip == CRYP… in CRYP_AES_Decrypt()
2433 if (hcryp->Init.Algorithm != CRYP_AES_CTR) /*ECB or CBC*/ in CRYP_AES_Decrypt()
2440 if ((hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) || \ in CRYP_AES_Decrypt()
2441 (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ALWAYS)) in CRYP_AES_Decrypt()
2443 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt()
2445 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2454 else if (hcryp->Init.KeyIVConfigSkip == CRYP_IVCONFIG_ONCE) in CRYP_AES_Decrypt()
2457 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2481 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt()
2483 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt()
2485 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2496 if (hcryp->Init.Algorithm != CRYP_AES_CTR) /*ECB or CBC*/ in CRYP_AES_Decrypt()
2502 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt()
2504 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt()
2506 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2527 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt()
2537 if (hcryp->Init.KeyIVConfigSkip == CRYP_IVCONFIG_ONCE) in CRYP_AES_Decrypt()
2542 if (hcryp->Init.Algorithm != CRYP_AES_CTR) /*ECB or CBC*/ in CRYP_AES_Decrypt()
2549 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2568 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2609 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AES_Decrypt_IT()
2631 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_IT()
2638 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2640 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_IT()
2642 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2680 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2682 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_IT()
2684 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2696 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_IT()
2702 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_IT()
2704 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2706 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2739 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt_IT()
2787 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AES_Decrypt_DMA()
2809 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_DMA()
2816 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2818 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_DMA()
2820 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2858 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2860 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_DMA()
2862 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2874 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_DMA()
2880 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_DMA()
2882 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2884 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2917 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt_DMA()
2973 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_DMAInCplt()
2975 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_DMAInCplt()
2979 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_DMAInCplt()
2988 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_DMAInCplt()
3004 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_DMAInCplt()
3005 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_DMAInCplt()
3089 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_DMAOutCplt()
3090 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_DMAOutCplt()
3147 if (((hcryp->Init.Algorithm & CRYP_AES_GCM_GMAC) != CRYP_AES_GCM_GMAC) in CRYP_DMAOutCplt()
3148 && ((hcryp->Init.Algorithm & CRYP_AES_CCM) != CRYP_AES_CCM)) in CRYP_DMAOutCplt()
3221 if ((hcryp->Init.Algorithm & CRYP_AES_GCM_GMAC) != CRYP_AES_GCM_GMAC) in CRYP_SetDMAConfig()
3550 if (hcryp->Init.pKey != NULL) in CRYP_SetKey()
3555 hcryp->Instance->KEYR7 = *(uint32_t *)(hcryp->Init.pKey); in CRYP_SetKey()
3556 hcryp->Instance->KEYR6 = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_SetKey()
3557 hcryp->Instance->KEYR5 = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_SetKey()
3558 hcryp->Instance->KEYR4 = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_SetKey()
3559 hcryp->Instance->KEYR3 = *(uint32_t *)(hcryp->Init.pKey + 4U); in CRYP_SetKey()
3560 hcryp->Instance->KEYR2 = *(uint32_t *)(hcryp->Init.pKey + 5U); in CRYP_SetKey()
3561 hcryp->Instance->KEYR1 = *(uint32_t *)(hcryp->Init.pKey + 6U); in CRYP_SetKey()
3562 hcryp->Instance->KEYR0 = *(uint32_t *)(hcryp->Init.pKey + 7U); in CRYP_SetKey()
3565 hcryp->Instance->KEYR3 = *(uint32_t *)(hcryp->Init.pKey); in CRYP_SetKey()
3566 hcryp->Instance->KEYR2 = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_SetKey()
3567 hcryp->Instance->KEYR1 = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_SetKey()
3568 hcryp->Instance->KEYR0 = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_SetKey()
3585 if (hcryp->Init.pInitVect != NULL) in CRYP_SetIV()
3588 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.pInitVect); in CRYP_SetIV()
3589 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.pInitVect + 1U); in CRYP_SetIV()
3590 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.pInitVect + 2U); in CRYP_SetIV()
3591 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.pInitVect + 3U); in CRYP_SetIV()
3614 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process()
3647 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process()
3649 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process()
3820 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_AESGCM_Process_IT()
3822 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_AESGCM_Process_IT()
3826 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_AESGCM_Process_IT()
3829 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process_IT()
3862 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process_IT()
3864 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_IT()
3908 if (hcryp->Init.HeaderSize == 0U) /*header phase is skipped*/ in CRYP_AESGCM_Process_IT()
4006 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4023 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4024 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_AESGCM_Process_IT()
4049 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4051 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4053 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4055 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4167 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process_DMA()
4200 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process_DMA()
4202 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_DMA()
4276 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process()
4308 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process()
4310 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process()
4317 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process()
4318 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process()
4319 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process()
4320 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process()
4477 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process_IT()
4510 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process_IT()
4512 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_IT()
4519 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process_IT()
4520 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process_IT()
4521 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process_IT()
4522 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process_IT()
4559 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_AESCCM_Process_IT()
4561 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_AESCCM_Process_IT()
4565 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_AESCCM_Process_IT()
4577 if (hcryp->Init.Algorithm == CRYP_AES_CCM) in CRYP_AESCCM_Process_IT()
4621 … if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_AESCCM_Process_IT()
4622 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_AESCCM_Process_IT()
4667 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4683 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4684 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_AESCCM_Process_IT()
4709 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4711 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4713 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4715 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4763 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_AESCCM_Process_IT()
4764 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_AESCCM_Process_IT()
4818 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process_DMA()
4852 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process_DMA()
4854 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_DMA()
4861 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process_DMA()
4862 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process_DMA()
4863 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process_DMA()
4864 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process_DMA()
4949 if (!((hcryp->Init.Algorithm == CRYP_AES_CCM) && (hcryp->KeyIVConfig == 1U))) in CRYP_GCMCCM_SetPayloadPhase_IT()
5021 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_GCMCCM_SetPayloadPhase_IT()
5022 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_GCMCCM_SetPayloadPhase_IT()
5200 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase()
5202 size_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase()
5206 size_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase()
5224 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5226 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5228 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5230 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5247 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5249 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5251 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5253 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5266 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5282 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5283 tmp &= mask[(hcryp->Init.DataType * 2U) + (size_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase()
5305 MODIFY_REG(hcryp->Instance->CR, AES_CR_DATATYPE, hcryp->Init.DataType); in CRYP_GCMCCM_SetHeaderPhase()
5334 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase_DMA()
5336 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5340 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5358 if (CRYP_SetHeaderDMAConfig(hcryp, (uint32_t)(hcryp->Init.Header), in CRYP_GCMCCM_SetHeaderPhase_DMA()
5372 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_DMA()
5388 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_DMA()
5389 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5455 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase_IT()
5457 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase_IT()
5461 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase_IT()
5476 if (hcryp->Init.Algorithm == CRYP_AES_CCM) in CRYP_GCMCCM_SetHeaderPhase_IT()
5519 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_GCMCCM_SetHeaderPhase_IT()
5520 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_GCMCCM_SetHeaderPhase_IT()
5583 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5585 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5587 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5589 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5598 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5615 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5616 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase_IT()
5854 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey); in CRYP_Read_KeyRegisters()
5856 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_Read_KeyRegisters()
5858 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_Read_KeyRegisters()
5860 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_Read_KeyRegisters()
5862 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 4U); in CRYP_Read_KeyRegisters()
5864 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 5U); in CRYP_Read_KeyRegisters()
5866 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 6U); in CRYP_Read_KeyRegisters()
5868 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 7U); in CRYP_Read_KeyRegisters()
5871 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey); in CRYP_Read_KeyRegisters()
5873 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_Read_KeyRegisters()
5875 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_Read_KeyRegisters()
5877 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_Read_KeyRegisters()
5950 if (((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount) >= 4U)) in CRYP_PhaseProcessingResume()
5953 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
5955 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
5957 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
5959 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
5965 for (loopcounter = 0U; loopcounter < (hcryp->Init.HeaderSize % 4U); loopcounter++) in CRYP_PhaseProcessingResume()
5967 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6021 …if ((((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES… in CRYP_PhaseProcessingResume()
6022 …(((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM… in CRYP_PhaseProcessingResume()