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.

CC2541 AES加密使用CBC模式,如何配置zeropadding填充?

Other Parts Discussed in Thread: CC2541

   各位大师:

    在开发使用CC2541蓝牙时,与第三方APP对接时,需要采用AES的CBC加密方式,同时采用zeropadding填充,请问题如何配置?或是哪个地方可以配置?

    通过下面把偏移量,密钥及要上传的数据传进去加密,结果如下:

   参数如下:

uint8 IVData[16] = {"1234567890abcdef"};  //偏移量
uint8 keyNewTest[16] = {0x44,0x72,0xdf,0x6e,0x0,0x4a ,0xbf, 0x6c, 0x1, 0x49, 0xbf, 0x6c, 0x1, 0x4f, 0xbf, 0x6c};//密钥
uint8 newDataBuf[32];//加密完数据存储
uint8 dataCrypt[16]={"12345601010702"};//加密的数据

  调用下面函数

AesLoadIV(IVData);
ssp_HW_KeyInit(keyNewTest);

LL_Encrypt(keyNewTest, dataCrypt, newDataBuf); //加密

得到结果:0x6e 0x75 0x49 0x1b 0xa0 0xe1 0xa1 0x9d 0x3c 0xac 0x24 0x76 0x5c 0xc1 0xb2 0x57

而对方实际值为:0xf7 0x2f 0x0 0xed 0xfc 0x2a 0x83 0xcd 0xc9 0x6c 0x5 0xbc 0x95 0x64 0xa6 0x75

请帮忙协助处理,谢谢先!