tiny-AES-c icon indicating copy to clipboard operation
tiny-AES-c copied to clipboard

Add CCM mode

Open cy18 opened this issue 4 years ago • 4 comments

I have written a python script to generate test cases with different length of data, nonce and tag, However, only one case is added to test.c . Should I upload the scripts, too?

This version is just for review and not ready to be merged. Any comments or suggestions are welcomed.

cy18 avatar Jul 03 '20 04:07 cy18

I have written a python script to generate test cases with different length of data, nonce and tag, However, only one case is added to test.c . Should I upload the scripts, too?

Nah, I think I get the point. I do like the idea though. I've done something similar e.g. with the bignum library: using Python to generate random inputs -> calculate expected output, and then compare results with the C-code.

This version is just for review and not ready to be merged. Any comments or suggestions are welcomed.

At first glance it looks super clean :)

I'll take a deeper dive tonight, when I get home from work.

kokke avatar Jul 03 '20 07:07 kokke

Sorry for the silence, but I did not get around to writing something substantial after reviewing your code.

I have a few ideas I would like to try out, e.g. consolidating the CCM struct into the already-existing context object.

I am on vacation for the next two weeks though, so please bear with me until I’m back.

kokke avatar Jul 09 '20 08:07 kokke

No hurry.

Why not use different context types for each of modes? This would make it more extensible.

cy18 avatar Jul 10 '20 00:07 cy18

Has there been progress on this? CCM support would be a terrific addition to tiny-AES! In support of CCM over GCM, the CTR mode implementation is particularly attractive due to its exceptionally small footprint. By comparison, an existing Tiny-AES-GCM implementation (https://github.com/FukuanWang/tiny_aes_gcm) consumes 1.4K more flash than stock TinyAES-CTR (which doesn't sound like a lot but breaks my budget). If CCM could be implemented without a huge expansion of the CTR footprint, it would be a great addition to tiny-AES.

Many thanks to the devs!

dalbert2 avatar Oct 17 '22 15:10 dalbert2