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()
2528 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt()
2530 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt()
2532 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2538 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt()
2548 if (hcryp->Init.KeyIVConfigSkip == CRYP_IVCONFIG_ONCE) in CRYP_AES_Decrypt()
2553 if (hcryp->Init.Algorithm != CRYP_AES_CTR) /*ECB or CBC*/ in CRYP_AES_Decrypt()
2560 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2579 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt()
2620 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AES_Decrypt_IT()
2642 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_IT()
2649 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2651 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_IT()
2653 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2691 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2693 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_IT()
2695 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2707 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_IT()
2713 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_IT()
2715 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2717 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2751 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_IT()
2753 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_IT()
2755 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_IT()
2761 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt_IT()
2809 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AES_Decrypt_DMA()
2831 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_DMA()
2838 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2840 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_DMA()
2842 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2880 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2882 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AES_Decrypt_DMA()
2884 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2896 if (hcryp->Init.Algorithm != CRYP_AES_CTR) in CRYP_AES_Decrypt_DMA()
2902 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_DMA()
2904 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2906 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2940 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AES_Decrypt_DMA()
2942 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AES_Decrypt_DMA()
2944 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AES_Decrypt_DMA()
2950 if (hcryp->Init.Algorithm != CRYP_AES_ECB) in CRYP_AES_Decrypt_DMA()
3006 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_DMAInCplt()
3008 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_DMAInCplt()
3012 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_DMAInCplt()
3021 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_DMAInCplt()
3037 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_DMAInCplt()
3038 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_DMAInCplt()
3122 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_DMAOutCplt()
3123 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_DMAOutCplt()
3180 if (((hcryp->Init.Algorithm & CRYP_AES_GCM_GMAC) != CRYP_AES_GCM_GMAC) in CRYP_DMAOutCplt()
3181 && ((hcryp->Init.Algorithm & CRYP_AES_CCM) != CRYP_AES_CCM)) in CRYP_DMAOutCplt()
3254 if ((hcryp->Init.Algorithm & CRYP_AES_GCM_GMAC) != CRYP_AES_GCM_GMAC) in CRYP_SetDMAConfig()
3583 if (hcryp->Init.pKey != NULL) in CRYP_SetKey()
3588 hcryp->Instance->KEYR7 = *(uint32_t *)(hcryp->Init.pKey); in CRYP_SetKey()
3589 hcryp->Instance->KEYR6 = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_SetKey()
3590 hcryp->Instance->KEYR5 = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_SetKey()
3591 hcryp->Instance->KEYR4 = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_SetKey()
3592 hcryp->Instance->KEYR3 = *(uint32_t *)(hcryp->Init.pKey + 4U); in CRYP_SetKey()
3593 hcryp->Instance->KEYR2 = *(uint32_t *)(hcryp->Init.pKey + 5U); in CRYP_SetKey()
3594 hcryp->Instance->KEYR1 = *(uint32_t *)(hcryp->Init.pKey + 6U); in CRYP_SetKey()
3595 hcryp->Instance->KEYR0 = *(uint32_t *)(hcryp->Init.pKey + 7U); in CRYP_SetKey()
3598 hcryp->Instance->KEYR3 = *(uint32_t *)(hcryp->Init.pKey); in CRYP_SetKey()
3599 hcryp->Instance->KEYR2 = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_SetKey()
3600 hcryp->Instance->KEYR1 = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_SetKey()
3601 hcryp->Instance->KEYR0 = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_SetKey()
3618 if (hcryp->Init.pInitVect != NULL) in CRYP_SetIV()
3621 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.pInitVect); in CRYP_SetIV()
3622 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.pInitVect + 1U); in CRYP_SetIV()
3623 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.pInitVect + 2U); in CRYP_SetIV()
3624 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.pInitVect + 3U); in CRYP_SetIV()
3647 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process()
3680 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESGCM_Process()
3684 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process()
3686 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process()
3696 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESGCM_Process()
3699 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process()
3889 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_AESGCM_Process_IT()
3891 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_AESGCM_Process_IT()
3895 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_AESGCM_Process_IT()
3898 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process_IT()
3931 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESGCM_Process_IT()
3935 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process_IT()
3937 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_IT()
3947 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESGCM_Process_IT()
3950 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_IT()
4009 if (hcryp->Init.HeaderSize == 0U) /*header phase is skipped*/ in CRYP_AESGCM_Process_IT()
4107 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4124 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4125 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_AESGCM_Process_IT()
4150 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4152 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4154 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4156 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESGCM_Process_IT()
4268 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESGCM_Process_DMA()
4301 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESGCM_Process_DMA()
4305 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESGCM_Process_DMA()
4307 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_DMA()
4317 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESGCM_Process_DMA()
4320 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESGCM_Process_DMA()
4409 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process()
4441 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESCCM_Process()
4445 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process()
4447 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process()
4457 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESCCM_Process()
4460 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process()
4486 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process()
4487 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process()
4488 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process()
4489 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process()
4646 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process_IT()
4679 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESCCM_Process_IT()
4683 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process_IT()
4685 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_IT()
4695 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESCCM_Process_IT()
4698 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_IT()
4720 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process_IT()
4721 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process_IT()
4722 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process_IT()
4723 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process_IT()
4760 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_AESCCM_Process_IT()
4762 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_AESCCM_Process_IT()
4766 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_AESCCM_Process_IT()
4778 if (hcryp->Init.Algorithm == CRYP_AES_CCM) in CRYP_AESCCM_Process_IT()
4822 … if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_AESCCM_Process_IT()
4823 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_AESCCM_Process_IT()
4868 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4884 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4885 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_AESCCM_Process_IT()
4910 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4912 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4914 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4916 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_AESCCM_Process_IT()
4964 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_AESCCM_Process_IT()
4965 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_AESCCM_Process_IT()
5019 if (hcryp->Init.KeyIVConfigSkip == CRYP_KEYIVCONFIG_ONCE) in CRYP_AESCCM_Process_DMA()
5053 if (hcryp->Init.KeyIVConfigSkip != CRYP_KEYNOCONFIG) in CRYP_AESCCM_Process_DMA()
5057 if (hcryp->Init.KeyMode != CRYP_KEYMODE_SHARED) in CRYP_AESCCM_Process_DMA()
5059 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_DMA()
5069 … if ((hcryp->Init.KeySelect == CRYP_KEYSEL_NORMAL) && (hcryp->Init.KeyMode == CRYP_KEYMODE_NORMAL)) in CRYP_AESCCM_Process_DMA()
5072 CRYP_SetKey(hcryp, hcryp->Init.KeySize); in CRYP_AESCCM_Process_DMA()
5094 hcryp->Instance->IVR3 = *(uint32_t *)(hcryp->Init.B0); in CRYP_AESCCM_Process_DMA()
5095 hcryp->Instance->IVR2 = *(uint32_t *)(hcryp->Init.B0 + 1U); in CRYP_AESCCM_Process_DMA()
5096 hcryp->Instance->IVR1 = *(uint32_t *)(hcryp->Init.B0 + 2U); in CRYP_AESCCM_Process_DMA()
5097 hcryp->Instance->IVR0 = *(uint32_t *)(hcryp->Init.B0 + 3U); in CRYP_AESCCM_Process_DMA()
5182 if (!((hcryp->Init.Algorithm == CRYP_AES_CCM) && (hcryp->KeyIVConfig == 1U))) in CRYP_GCMCCM_SetPayloadPhase_IT()
5254 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_GCMCCM_SetPayloadPhase_IT()
5255 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_GCMCCM_SetPayloadPhase_IT()
5433 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase()
5435 size_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase()
5439 size_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase()
5457 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5459 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5461 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5463 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5480 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5482 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5484 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5486 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5499 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5515 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase()
5516 tmp &= mask[(hcryp->Init.DataType * 2U) + (size_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase()
5538 MODIFY_REG(hcryp->Instance->CR, AES_CR_DATATYPE, hcryp->Init.DataType); in CRYP_GCMCCM_SetHeaderPhase()
5567 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase_DMA()
5569 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5573 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5591 if (CRYP_SetHeaderDMAConfig(hcryp, (uint32_t)(hcryp->Init.Header), in CRYP_GCMCCM_SetHeaderPhase_DMA()
5605 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_DMA()
5621 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_DMA()
5622 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase_DMA()
5688 if (hcryp->Init.HeaderWidthUnit == CRYP_HEADERWIDTHUNIT_WORD) in CRYP_GCMCCM_SetHeaderPhase_IT()
5690 headersize_in_bytes = hcryp->Init.HeaderSize * 4U; in CRYP_GCMCCM_SetHeaderPhase_IT()
5694 headersize_in_bytes = hcryp->Init.HeaderSize; in CRYP_GCMCCM_SetHeaderPhase_IT()
5709 if (hcryp->Init.Algorithm == CRYP_AES_CCM) in CRYP_GCMCCM_SetHeaderPhase_IT()
5752 if (((mode == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES_GCM_GMAC)) || in CRYP_GCMCCM_SetHeaderPhase_IT()
5753 ((mode == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM))) in CRYP_GCMCCM_SetHeaderPhase_IT()
5816 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5818 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5820 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5822 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5831 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5848 tmp = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_GCMCCM_SetHeaderPhase_IT()
5849 tmp &= mask[(hcryp->Init.DataType * 2U) + (headersize_in_bytes % 4U)]; in CRYP_GCMCCM_SetHeaderPhase_IT()
6087 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey); in CRYP_Read_KeyRegisters()
6089 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_Read_KeyRegisters()
6091 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_Read_KeyRegisters()
6093 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_Read_KeyRegisters()
6095 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 4U); in CRYP_Read_KeyRegisters()
6097 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 5U); in CRYP_Read_KeyRegisters()
6099 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 6U); in CRYP_Read_KeyRegisters()
6101 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 7U); in CRYP_Read_KeyRegisters()
6104 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey); in CRYP_Read_KeyRegisters()
6106 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 1U); in CRYP_Read_KeyRegisters()
6108 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 2U); in CRYP_Read_KeyRegisters()
6110 *(uint32_t *)(keyaddr) = *(uint32_t *)(hcryp->Init.pKey + 3U); in CRYP_Read_KeyRegisters()
6183 if (((hcryp->Init.HeaderSize) - (hcryp->CrypHeaderCount) >= 4U)) in CRYP_PhaseProcessingResume()
6186 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6188 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6190 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6192 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6198 for (loopcounter = 0U; loopcounter < (hcryp->Init.HeaderSize % 4U); loopcounter++) in CRYP_PhaseProcessingResume()
6200 hcryp->Instance->DINR = *(uint32_t *)(hcryp->Init.Header + hcryp->CrypHeaderCount); in CRYP_PhaseProcessingResume()
6254 …if ((((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_ENCRYPT) && (hcryp->Init.Algorithm == CRYP_AES… in CRYP_PhaseProcessingResume()
6255 …(((cr_temp & AES_CR_MODE) == CRYP_OPERATINGMODE_DECRYPT) && (hcryp->Init.Algorithm == CRYP_AES_CCM… in CRYP_PhaseProcessingResume()