Question and feedback for AES on LPC43Sxx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Question and feedback for AES on LPC43Sxx

1,451 次查看
martinkoehler
Contributor II

Hi everybody,

I just work with the LPC43S30 and now with the AES. As I don't like the LpcOpen stuff (sorry for that, but bugs and bad documentation + sometimes performance) I usually write my libs by myself.

I write my code according to the UM10503 (http://www.nxp.com/documents/user_manual/UM10503.pdf ) rev 2.1 from Dec 2015. The description of AES has some problems and my code does not work by the way. So here's some feedback.

First:

There is a difference in function descrition from UM to LpcOpen (aes_18xx_43xx.c) for some function.

   aes_Init, aes_LoadKey1/2,  aes_LoadKeySW, aes_LoadIV_SW, aes_LoadIV_IC

all missing the return value.

Second:

The aes_Operate Parameter3 is described poorly. It seems to mean (by looking at the LpcOpen) the size in 128bit words (a unit) but it also may mean the parameter being an unsigned 128bit word.

It is unclear to me if the operate works with MSByte, LSByte, MSBit, LSBit order. Also it is unclear if the IV vector stays over multiple operate calls (which would be extremly useful as the coded data may be to long or seperated over multiple memory areas).

Third:

It seems like the setting of keys (aes_LoadKeySW) does not work with normal code (which I see no reason and also no hint to). It needs the "secure boot feature". Can you confirm this problem? And perhaps add it to the UM? I'm a bit puzzled there is no error returning when trying to load the key.

Have a nice day

标签 (1)
标记 (3)
0 项奖励
回复
3 回复数

1,123 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Martin,

Thanks for your feedback, I have sent it to the LPCOpen development team.

Best Regards!
Carlos Mendoza
Technical Support Engineer

0 项奖励
回复

1,123 次查看
martinkoehler
Contributor II

For the third point I can discard the problem. It works just fine for me. The post on forum about this point seems not to be correct.

0 项奖励
回复

1,123 次查看
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Martin,

 

I have just received the following response from the development team:

Answer to 1st question

I agree with you that the AES function should have return value for the error number, will report internally and they should fix them in next release.

 

Answer to 2nd question

The endianness is shown at Fig 32. AES endianness, frankly saying, the usage is not common as other cipher algorithms

ECB mode doesn't require IV. CBC mode uses IV to XOR block[0] then encrypt with key, it should be kept unless next aes_LoadIV_SW for long message.

 

Best Regards!
Carlos Mendoza
Technical Support Engineer

0 项奖励
回复