PeculiarVentures / webcrypto-core

A input validation layer for WebCrypto polyfills.
MIT License
28 stars 13 forks source link

checkDeriveBits: length is not multiple of 8 #31

Closed j-berman closed 3 years ago

j-berman commented 3 years ago

Not a huge deal, but providing an HMAC key length is supposed to be optional. The API relies on the hash algorithm provided to determine the length of the key, but the length can be overridden. See expected usage here.

When I don't provide a length when trying to derive an HMAC key from an HKDF key, webcrypto-core throws with OperationError: length: Is not multiple of 8

microshine commented 3 years ago

@j-berman I fixed it (by default it sets 512bits as browsers do) and published the new version v1.1.10