HMAC-SHA256 with Se05x_API_WriteSymmKey

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HMAC-SHA256 with Se05x_API_WriteSymmKey

Jump to solution
477 Views
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 Kudos
Reply
1 Solution
462 Views
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
2 Replies
456 Views
jowin202
Contributor I

Thank you very much. It works now 

0 Kudos
Reply
463 Views
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 Kudos
Reply