L parameter for CCM #252

Closed
opened 2017-07-14 10:43:07 -05:00 by s09bQ5 · 2 comments
s09bQ5 commented 2017-07-14 10:43:07 -05:00 (Migrated from github.com)

If I understand RFC3610 correctly, L can be chosen freely as long as it allows the payload size to be encoded. But the current implementation of ccm_init uses the minimal value for L that can encode the payload size. So right now libtomcrypt can not be used to decrypt CCM messages that use an L that is bigger than necessary. In OpenSSL L defaults to 8 and can be changed to any allowed value.

If I understand RFC3610 correctly, L can be chosen freely as long as it allows the payload size to be encoded. But the current implementation of ccm_init uses the minimal value for L that can encode the payload size. So right now libtomcrypt can not be used to decrypt CCM messages that use an L that is bigger than necessary. In OpenSSL L defaults to 8 and can be changed to any allowed value.
karel-m commented 2017-07-14 13:46:35 -05:00 (Migrated from github.com)

If I understand our implementation correctly you can "choose" L indirectly by choosing nonce of proper length: L = 15 - length(nonce) where 7 <= length(nonce) <= 13

If I understand our implementation correctly you can "choose" `L` indirectly by choosing `nonce` of proper length: `L = 15 - length(nonce)` where `7 <= length(nonce) <= 13`
s09bQ5 commented 2017-07-14 14:05:50 -05:00 (Migrated from github.com)

Oh, you are right, ccm_add_nonce increases L or truncates the nonce depending on its size.
Sorry for the noise.

Oh, you are right, ccm_add_nonce increases L or truncates the nonce depending on its size. Sorry for the noise.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libtom/libtomcrypt#252
No description provided.