|
Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm, |
|
CryptoKey baseKey, |
|
unsigned long length); |
The SubtleCrypto.deriveBits function length argument's IDL does not allow null to be passed despite there being a special handling for its possible null value in all deriveBits operations, for most it throws but for ECDH, X25519, and X448 it is defined as returning all generated bits.
I believe the length argument of deriveBits should be made nullable like so?
Promise<ArrayBuffer> deriveBits(AlgorithmIdentifier algorithm,
CryptoKey baseKey,
unsigned long? length);
^ nullable?
In WPT there are even tests for this behaviour.
https://github.com/web-platform-tests/wpt/blob/3174b85610804424ac4c6c2a194a08220402a00e/WebCryptoAPI/derive_bits_keys/ecdh_bits.js#L58-L66
webcrypto/spec/Overview.html
Lines 1258 to 1260 in 004f26a
The SubtleCrypto.deriveBits function
lengthargument's IDL does not allownullto be passed despite there being a special handling for its possiblenullvalue in all deriveBits operations, for most it throws but for ECDH, X25519, and X448 it is defined as returning all generated bits.I believe the
lengthargument of deriveBits should be made nullable like so?In WPT there are even tests for this behaviour.
https://github.com/web-platform-tests/wpt/blob/3174b85610804424ac4c6c2a194a08220402a00e/WebCryptoAPI/derive_bits_keys/ecdh_bits.js#L58-L66