@@ -323,7 +323,7 @@ int32_t Crypto_TC_Check_IV_Setup(SecurityAssociation_t *sa_ptr, uint8_t *p_new_e
323
323
}
324
324
325
325
/**
326
- * @brief Function: Crypto_TC_Do_Encrypt_PLAINTEXT
326
+ * @brief Function: Crypto_TC_Encrypt
327
327
* Handles Plaintext TC Encryption
328
328
* @param sa_service_type: uint8_t
329
329
* @param sa_ptr: SecurityAssociation_t*
@@ -340,11 +340,11 @@ int32_t Crypto_TC_Check_IV_Setup(SecurityAssociation_t *sa_ptr, uint8_t *p_new_e
340
340
* @param pkcs_padding:uint32_t
341
341
* @return int32: Success/Failure
342
342
**/
343
- int32_t Crypto_TC_Do_Encrypt_PLAINTEXT (uint8_t sa_service_type , SecurityAssociation_t * sa_ptr , uint16_t * mac_loc ,
344
- uint16_t tf_payload_len , uint8_t segment_hdr_len , uint8_t * p_new_enc_frame ,
345
- crypto_key_t * ekp , uint8_t * * aad , uint8_t ecs_is_aead_algorithm ,
346
- uint16_t * index_p , const uint8_t * p_in_frame , char * cam_cookies ,
347
- uint32_t pkcs_padding )
343
+ int32_t Crypto_TC_Encrypt (uint8_t sa_service_type , SecurityAssociation_t * sa_ptr , uint16_t * mac_loc ,
344
+ uint16_t tf_payload_len , uint8_t segment_hdr_len , uint8_t * p_new_enc_frame ,
345
+ crypto_key_t * ekp , uint8_t * * aad , uint8_t ecs_is_aead_algorithm ,
346
+ uint16_t * index_p , const uint8_t * p_in_frame , char * cam_cookies ,
347
+ uint32_t pkcs_padding )
348
348
{
349
349
int32_t status = CRYPTO_LIB_SUCCESS ;
350
350
uint16_t index = * index_p ;
@@ -524,13 +524,13 @@ int32_t Crypto_TC_Do_Encrypt_PLAINTEXT(uint8_t sa_service_type, SecurityAssociat
524
524
}
525
525
526
526
/**
527
- * @brief Function: Crypto_TC_Do_Encrypt_NONPLAINTEXT
528
- * Handles NON-Plaintext TC Encryption
527
+ * @brief Function: Crypto_TC_Increment_IV_ARSN
528
+ * Handles Incrementing IV and ARSN of SA
529
529
* @param sa_service_type: uint8_t
530
530
* @param sa_ptr: SecurityAssociation_t*
531
531
* @return int32: Success/Failure
532
532
**/
533
- void Crypto_TC_Do_Encrypt_NONPLAINTEXT (uint8_t sa_service_type , SecurityAssociation_t * sa_ptr )
533
+ void Crypto_TC_Increment_IV_ARSN (uint8_t sa_service_type , SecurityAssociation_t * sa_ptr )
534
534
{
535
535
if (sa_service_type != SA_PLAINTEXT )
536
536
{
@@ -617,17 +617,17 @@ int32_t Crypto_TC_Do_Encrypt(uint8_t sa_service_type, SecurityAssociation_t *sa_
617
617
{
618
618
int32_t status = CRYPTO_LIB_SUCCESS ;
619
619
uint16_t index = * index_p ;
620
- status = Crypto_TC_Do_Encrypt_PLAINTEXT (sa_service_type , sa_ptr , mac_loc , tf_payload_len , segment_hdr_len ,
621
- p_new_enc_frame , ekp , aad , ecs_is_aead_algorithm , index_p , p_in_frame ,
622
- cam_cookies , pkcs_padding );
620
+ status = Crypto_TC_Encrypt (sa_service_type , sa_ptr , mac_loc , tf_payload_len , segment_hdr_len ,
621
+ p_new_enc_frame , ekp , aad , ecs_is_aead_algorithm , index_p , p_in_frame ,
622
+ cam_cookies , pkcs_padding );
623
623
if (status != CRYPTO_LIB_SUCCESS )
624
624
{
625
625
Crypto_TC_Safe_Free_Ptr (* aad );
626
626
mc_if -> mc_log (status );
627
627
return status ;
628
628
}
629
629
// TODO: Status?
630
- Crypto_TC_Do_Encrypt_NONPLAINTEXT (sa_service_type , sa_ptr );
630
+ Crypto_TC_Increment_IV_ARSN (sa_service_type , sa_ptr );
631
631
/*
632
632
** End Authentication / Encryption
633
633
*/
0 commit comments