Owen Kirby osk@exegin.com writes:
It also occurs to me that the my formula for calculating the maximum message size from L is completely wrong. L basically specifies the size of the counter field (in bytes), so it should really be maxlength = (1 << (L*8)) - 1.
I think it would be nice with some public macro in ccm.h which gives the maximum message size for a given nonce size, together with constants CCM_MIN_NONCE_SIZE and CCM_MAX_NONCE_SIZE. There should be some reasonably easy way for an application to check if potential ccm parameters are valid.
If I read ccm.c correctly, nonce size is in the range 7...14 bytes, inclusive.
Regards, /Niels