AEAD interface for decryption using the function crypto_aead_decrypt()

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

AEAD interface for decryption using the function crypto_aead_decrypt()

553 Views
samirsamaha
Contributor II

I am using the SEC driver (TALITOS P1020) to encrypt and decrypt the data. I
am using the AEAD interface. For decryption I am using the function
crypto_aead_decrypt() which I guess it expect the encrypted data followed by the digest
(MAC data). My problem is that the digest is truncated. I only receive 12
bytes instead of 16 bytes. My question is how can I tell the driver that the
digest is truncated and only 12 bytes are provided. The error that I am receiving
when I try to decrypt is 74 which is EBADMSG

0 Kudos
1 Reply

389 Views
bpe
NXP Employee
NXP Employee

AEAD API provides crypto_aead_setauthsize() call that sets the size of the authentication tag. Details can be found here:

crypto_aead_setauthsize

Linux/include/linux/crypto.h - Linux Cross Reference - Free Electrons

Linux/crypto/aead.c - Linux Cross Reference - Free Electrons


Have a great day,
Platon

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

0 Kudos