intel / tinycrypt

tinycrypt is a library of cryptographic algorithms with a focus on small, simple implementation.
Other
446 stars 156 forks source link

AES CMAC token generation bug if input data is chunked #51

Open KonsKr opened 2 years ago

KonsKr commented 2 years ago

If the tc_cmac_update() function is called and fills the internal leftover cache completely, the following tc_cmac_final() call will produce a wrong token.

If the tc_cmac_update() is called with a data length which fills up the internal leftover cache completely, the leftover data will be processed instantly and is left empty. This is not the right behavior, because tc_cmac_final() requires that the last block is still in the leftover cache and not processed, because it need special treatment.

See pull request for fix and further information: #52

KonsKr commented 2 years ago

The issue was also addressed in pull request #34