Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support BigInt/Uint64Array in crypto.getRandomValues #29565

Merged
merged 1 commit into from
Jul 6, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 2, 2021

The check for "integer arrays" is to prevent people from using
getRandomValues with floating-point arrays, which doesn't work as people
might expect. However, the check was not updated when Chrome gained
support for BigInt64Array and BigUint64Array, which do work as expected.
This allows code fragments such as

const b = new BigInt64Array(10);
crypto.getRandomValues(b);

See w3c/webcrypto#255 for the spec issue.

Bug: 1225765
Change-Id: I338ecc5594492e6f329580f4e8f04d367f866361
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3002049
Reviewed-by: Mike West <[email protected]>
Commit-Queue: Timothy Gu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#898924}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

The check for "integer arrays" is to prevent people from using
getRandomValues with floating-point arrays, which doesn't work as people
might expect. However, the check was not updated when Chrome gained
support for BigInt64Array and BigUint64Array, which do work as expected.
This allows code fragments such as

    const b = new BigInt64Array(10);
    crypto.getRandomValues(b);

See w3c/webcrypto#255 for the spec issue.

Bug: 1225765
Change-Id: I338ecc5594492e6f329580f4e8f04d367f866361
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3002049
Reviewed-by: Mike West <[email protected]>
Commit-Queue: Timothy Gu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#898924}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants