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.

[参考译文] CC3235SF:CryptoCC32XX_encrypt 函数返回空值

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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1506245/cc3235sf-cryptocc32xx_encrypt-function-returns-null

器件型号:CC3235SF

工具/软件:

我正在尝试加密数据,加密工作正常有时,如果断开与服务器的连接,并尝试与服务器连接加密工作正常.
有时、在不断开与服务器的连接的情况下、CryptoCC32XX_encrypt 函数也会返回 NULL。

CryptoCC32XX_EncryptMethod 方法= CryptoCC32XX_AES_ECB;

void EncryptData (无符号字符*inputBuf、char *outputBuf、char *encryptionKey)

int32_t =-1;

aesCCMParams.AES.pkey =(const uint8_t*)(encryptionKey);
解密参数= aesCCMParams;
size_t padded_len = 0;
size_t encryptedDataLength = 0;
size_t decryptedDataLength = 0;

PKCS7_PAD (inputBuf、strlen (inputBuf)、&fadded_len);


RetVal = CryptoCC32XX_encrypt (cryptoHandle1、method、inputBuf、
strlen (inputBuf)、outputBuf、
&encryptedDataLength、&aesCCMParams);


if (retval = 0)

RetVal = CryptoCC32XX_Decuty (cryptoHandle1、method、outputBuf、
strlen (outputBuf)、&checkBuf、
解密数据长度、&decryptParams);

}
暴露

hStatus =失败;
}
}

在这种情况下、加密密钥是正确的、我接收到的填充长度也是正确的。 但  CryptoCC32XX_encrypt 函数的 outputbuf 为空、我没有收到任何数据。 加密状态返回错误。  

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

    尊敬的 Kavya:

    您能否逐步介绍"CryptoCC32XX_encrypt"并告诉我哪里返回 NULL? "_encrypt"内有一些函数、我想了解哪个函数返回 NULL。