aead using sec over af_alg

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

aead using sec over af_alg

1,338 次查看
td71522
Contributor I

Hi,

im working on the lx2160a with the sec engine. I can use the accelerators for hashing and ciphers successfully but I am struggling with use it for AEAD. I'm using the af_alg socket to communicate with the linux crypto api. At the marked position i get the error invalid Argument. I have no idead what to change, since i followed the documentation fof the kernel for the crypto api user interface.

Thanks in advance

TD

td71522_0-1669986938772.png

 

0 项奖励
回复
3 回复数

1,299 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Sorry for the delay. here is the update:
#####
Can you check if you are setting up the sockaddr_alg structure correctly?

Following is one example.
struct sockaddr_alg sa = {
    .salg_family = AF_ALG,
    .salg_type = "aead", /* this selects the symmetric cipher */
    .salg_name = "gcm(aes)" /* this is the cipher name */
};

The thing is that this is a standard Linux interface. We (NXP) can only control the ciphers registered by the SEC driver.
Also, it would be good know which specific algorithm are you trying to use.
#####

0 项奖励
回复

1,273 次查看
td71522
Contributor I
Thanks for the reply, i had an mistake in configuring the sec. I was able to fix the mistake and everything is working fine now.
0 项奖励
回复

1,337 次查看
td71522
Contributor I
the length in cmsg->cmsg_len = CMSG_LEN(CMSG_SPACE());
is meant to be cmsg->cmsg_len = CMSG_LEN(CMSG_SPACE(sizeof(initVector)));
idk why its missing
0 项奖励
回复