IV length vs. nonce in CCM mode

135 views
Skip to first unread message

Michaela Merz

unread,
Apr 7, 2013, 1:24:22 PM4/7/13
to sjcl-d...@googlegroups.com
Hi again:

BouncyCastle uses the IV as nonce in CCM. This doesn't fly, as SJCL's IV length can be > 13 octets and re-calculates the size of the nonce. Would it be safe to assume, that SJCL always reduces larger IVs to 13 bytes of nonce? Would it be safe to simply reduce the IV to 13 octets?

Thanks.

Michaela





Mike Hamburg

unread,
Apr 8, 2013, 1:44:53 AM4/8/13
to sjcl-d...@googlegroups.com
Hi,

You're more or less correct.  SJCL truncates the IV down to the appropriate size, which is something like 15 - min(2, ceiling(log_256(1+length of message))) bytes.  So at most 13, but possibly as few as 11 bytes if the message is at least 16 MiB long.

-- Mike

--
You received this message because you are subscribed to the Google Groups "SJCL discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sjcl-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages