gcm icv length

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

gcm icv length

Jump to solution
921 Views
kevinwhitfield
Contributor I

# AES GCM ICV

I've encountered an issue exercising the cipher-gcm sample under cryptodev-linux-1.8 of the 1703 SDK:  While performing a decryption with a full-sized ICV works, specifying shorter ICV values (by tweaking cao.len and cao.tag_len) does not consistently work across the documented range of 4-16 bytes.  More specifically:

  ICV Length      Result

  16                  SUCCEEDS

  15                  FAILS

  14                  SUCCEEDS

  13                  FAILS

  12                  SUCCEEDS

  11                  FAILS

  10                 SUCCEEDS

   9                  FAILS

   8                  SUCCEEDS

   7                  FAILS

   6                  SUCCEEDS

   5                  FAILS

   4                  SUCCEEDS

During the failures, a -EBADMSG failure is reported in the syslog after the caam driver detects an JRSTA_CCBERR_ERRID_ICVCHK error indication from the SEC:

Aug 22 17:40:07 c293pcie kernel: cryptodev: cipher-gcm[2479] (waitfor:256): error from async request: -74
Aug 22 17:40:07 c293pcie kernel: cryptodev: cipher-gcm[2479] (auth_n_crypt:681): cryptodev_cipher_decrypt: -74

0 Kudos
Reply
1 Solution
784 Views
bpe
NXP Employee
NXP Employee

The version of SEC engine in C29x HW does not support ICV checking
for odd length tags. Because the version of C29x AESA does not support
odd byte length ICV, it is expected  C29x fails GCM with an odd byte length ICV.

When performing AES GSM encrypt + tag generation, if you specify an
odd number, say 9B tag, the AESA would generate a 16B tag. The work
around is just to compare the first 9B in software .


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
785 Views
bpe
NXP Employee
NXP Employee

The version of SEC engine in C29x HW does not support ICV checking
for odd length tags. Because the version of C29x AESA does not support
odd byte length ICV, it is expected  C29x fails GCM with an odd byte length ICV.

When performing AES GSM encrypt + tag generation, if you specify an
odd number, say 9B tag, the AESA would generate a 16B tag. The work
around is just to compare the first 9B in software .


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply