HMAC-SHA256 with Se05x_API_WriteSymmKey

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

HMAC-SHA256 with Se05x_API_WriteSymmKey

跳至解决方案
568 次查看
jowin202
Contributor I

Hello,

I would like to insert a 32 byte HMAC to the SE05X and I following code:

const byte hmac_key[32] = {
  0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
  0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 
  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
  0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F
};

Se05x_API_WriteSymmKey(&_se05x_session, NULL, 3, objectId, SE05x_KeyID_KEK_NONE, hmac_key, sizeof(hmac_key), kSE05x_INS_NA, kSE05x_SymmKeyType_HMAC);

This returns 0x6A80.

objectId, in this case, is a free slot, without any objects in this place.

 

However, if I change kSE05x_SymmKeyType_HMAC to kSE05x_SymmKeyType_AES, the command works as it should.

 

when I import an AES key as a KEK and give the KEK_ID to this command, the error code stays the same.

 

Is there a proper solution (maybe without key wrapping)?

 

kind regards

0 项奖励
回复
1 解答
553 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @jowin202 ,

 

Please don't specify the maximum number of attempts to a secure object which can not be used for authentication. It works for AES key as AES key can be used for authentication.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
547 次查看
jowin202
Contributor I

Thank you very much. It works now 

0 项奖励
回复
554 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi @jowin202 ,

 

Please don't specify the maximum number of attempts to a secure object which can not be used for authentication. It works for AES key as AES key can be used for authentication.

 

Hope that helps,

 

Have a great day,
Kan


-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复