CC2745R10-Q1: When using the AES encryption function, the basic_ble module Bluetooth will disconnect.

Part Number: CC2745R10-Q1

CC2745 SDK (simplelink_lowpower_f3_sdk_9_14_02_16) DEMO merges the functionalities of the basic_ble and aesecb demo routines, with the expectation that when the Bluetooth function is working normally, AESECB encryption and decryption can be performed. After integrating the aesecb demo functionality into the basic_ble demo, the Bluetooth functionality can connect and operate normally, but the Bluetooth connection disconnects when performing AES encryption operations. Please help analyze the reason and the solution. Thank you.The code for the encryption feature is as follows

psa_aes_ecb_encrypt.c 

  • Hello Zhang,

    Thank you for reaching out. I am looking into this issue, please give me until Wednesday to get back to you with a response. Thanks.

    Eshaan

  • Hello, correcting the information. At first, we integrated the aesecb DEMO code into basic_ble, and when running the AESECB_open function, it directly went into an error. After searching online, it was said that the AES hardware resources were occupied by BLE, so we switched to the AES code from the third-party library in the SDK (source->third_party->psa_crypto). After integration, the encryption function runs normally, but the BLE connection disconnects during encryption operations, which is the problem I mentioned above. I hope this information is useful for analysis, thank you.

  • Hello Zhang,

    Can you tell me or provide me with a snippet of code that shows were in the BLE application you are calling AESECB_open function?

    Thanks

  • Hello ,

    I created a TASK in the basic_ble DEMO to run the aesecb DEMO encryption function. The AESECB_open function is the one called by the DEMO (as shown in the figure below). When calling the AESECB_open function, an error occurs, so I abandoned the code in the aesecb DEMO and used AES code from a third-party library (source->third_party->psa_crypto). After integrating, compiling, and running, when connecting to BLE via a mobile app and then calling the psa_cipher_encrypt encryption function, it causes the mobile BLE connection to disconnect and then immediately reconnect successfully. The current issue is how to solve the disconnection problem when calling psa_cipher_encrypt for encryption, rather than the AESECB_open call failure problem. Thank you.

  • Hello Zhang,

    I understand that you pivoted from AESECB_open to the psa_crypto library in order to work around the error, but my confusion is with this part of your problem:

    "integrating, compiling, and running, when connecting to BLE via a mobile app and then calling the psa_cipher_encrypt encryption function, it causes the mobile BLE connection to disconnect and then immediately reconnect successfully."

    I would like to understand where and when in the BLE Stack application you are calling this crypto function. For example, are you calling it when you get BLE_CONNECTION_ESTABLISHED, or somewhere else? This will help me to see where in the application following the connection is crypto operation actually happening. Thank you.

    Eshaan

  • HI:

    I also based my test on the basic_ble DEMO in the SDK. I am not clear about when and where to call the encryption function in the BLE Stack application. I only know from some information or consulting AI that it’s because BLE communication calls AES resources, and if the application layer also calls AES encryption, it will preempt the resources. It’s precisely because I don’t understand this part that I came to ask for help.

  • Hello Zhang,

    Can you please explain what exactly you are trying to implement in your application? So what is the use case, and what data/variable are you using AESECB on? Our AES resource is a part of the HSM, so there should not be any resource conflict as its behavior is independent of the ble communication, which happens on the radio layer. Thanks.

    Eshaan