This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23159 - Inconsistent "length" property when generating keys (bits vs bytes)
Summary: Inconsistent "length" property when generating keys (bits vs bytes)
Status: RESOLVED FIXED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Mark Watson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-04 19:42 UTC by Eric Roman
Modified: 2014-03-05 17:02 UTC (History)
2 users (show)

See Also:


Attachments

Description Eric Roman 2013-09-04 19:42:52 UTC
AesKeyGenParams.length -- is the key length in BITS
HmacKeyParams.length -- is the key length in BYTES

This inconsistency makes it easy to get things wrong.

Moreover, in the case where the key length is specified in bits, what is the expected behavior when passing a length which is not divisible by 8? (NSS for instance generates keys with integral byte lengths).
Comment 1 Mark Watson 2014-03-03 19:16:11 UTC
I suggest we align on bits instead of bytes.
Comment 2 Mark Watson 2014-03-05 17:02:56 UTC
Changeset da045968abe0 - change HMAC length from bytes to bits per email discussion