Open olegbespalov opened 4 months ago
Is this a problem with the go stdlib returning errors on those? Or in our implementation?
@mstoykov It's on our implementation, we need to handle such cases. In theory, it's not hard, but I stopped iterating on it for now since I want to wrap everything before release.
What?
While do have support of
deriveBits
operation (for the ECDH algorithm).However, the web platform test suite showed that the length argument could be a non-multiply of 8. In that case, we should implement the logic to support such values.
For now, we explicitly return an error if the length is a non-multiply of 8. see https://github.com/grafana/xk6-webcrypto/pull/79/commits/6c61c1b1d69b92c7a23ff0a989f4fd225a2fe907
Below is a snippet that could be run in the browser. It works in Chrome, but errors in Firefox.
Related PRs:
Why?
WebCrypto API defines it as possible to have a length that is non-multiply of 8.