工具/软件:
您好、
我已将下面 URL 中的示例代码合并到我自己的项目中并进行了测试、但无法按预期工作。
您知道原因是什么吗?
此外、这种行为是否存在任何时间或其他限制?
AESGCM_ReturnBehavior 设置为 AESGCM_Return_behaviore_callback。
AES-CCM 也表现出同样的现象。
[现象]
执行 AESGCM_oneStepEncrypt 后、返回值在回调中返回为 AESGCM_STATUS_SUCCESS、密文缓冲区包含预期值、
但 Mac 包含0x00。
如果在执行 AESGCM_oneStepEncrypt 后设置断点或等待500us、则它按预期工作。
operation.iv = iv; operation.ivLength = 12; operation.mac = mac; operation.macLength = sizeof(mac); encryptionResult = AESGCM_oneStepEncrypt(handle, &operation); HapiWaitUs(500); // ← If I insert a wait here it works fine. if (encryptionResult != AESGCM_STATUS_SUCCESS) { // ← Also, if I put a breakpoint here it works fine // handle error }
[条件]
SDK:simplelink_lowpower_f3_SDK_8_30_00_11_ea
[URL]
Software-https:/.../_a_e_s_g_c_m_8h.html
[样片]
对于 HSM 加速器、在分块返回模式下使用明文加密密钥进行单次调用 GCM 加密+身份验证
此致、
Katsuya