This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2745R10-Q1:调用 AESCCM_oneStepDecrypt 后回调无响应

Guru**** 2497145 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1560160/cc2745r10-q1-callback-not-responding-after-calling-aesccm_onestepdecrypt



我 尝试使用 AES-CCM 解密加密密钥、但我遇到了一个回调不响应的问题。
尽管如此、AESCCM_oneStepDecrypt 的返回值还是 AESCCM_STATUS_SUCCESS。
您能否提供有关解决此问题的指导?

虽然我不清楚原因、但我已经确认、只有在我按照以下步骤调用 AESCCM_oneStepDecrypt 时、回调才会响应:

  1. 使用 IAR 运行调试执行。
  2. 暂停在引用 AESCCM_oneStepDecrypt 返回值的行处(设置断点)。
  3. 单步执行并退出调用 AESCCM_oneStepDecrypt 的函数。
  4. 回调将做出响应。

【参数设置示例】
在解密时、我指定以下参数:

AESCCM_OneStepOperation_init(&stt_operation);
stt_operation.key             = Address of key information
stt_operation.aadLength       = 0
stt_operation.input           = Address of a 38-byte array
stt_operation.output          = Address of an array
stt_operation.inputLength     = 38
stt_operation.nonce           = Array of IV
stt_operation.nonceLength     = 16
stt_operation.mac             = Array of MAC
stt_operation.macLength       = 8

此外、我在初始化期间注册了回调、如下所示:

AESCCM_Params_init(&AESCCM_Params);
AESCCM_Params.returnBehavior = AESCCM_RETURN_BEHAVIOR_CALLBACK;
AESCCM_Params.callbackFxn = vos_CryptoIf_AESCCM_Callback;

【版本信息】

  • HSM 信息:FW 版本:3.0.0
  • 适用于 ARM 的 IAR Embedded Workbench:9.60.3.7274
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    抱歉、此问题已解决。
    我认为原因是在设置参数时使用局部变量、在执行回调之前参数超出了范围。
    用静态变量替换局部变量解决了该问题。