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

Align how digest copies bytes with the rest of the methods #43

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Apr 14, 2023

For methods taking ArrayBuffer, TypedArray or DataView as input, the specification often states that the underlying bytes should be copied. This is made so that modifying the data that's passed as argument in an asynchronous manner doesn't result in inconsistencies of the cryptographic operation.

This PR closes #42 and ensures that the digest method uses our internal exportArrayBuffer function which makes sure to return a copy of the underlying's buffer bytes.

@oleiade oleiade added the enhancement New feature or request label Apr 14, 2023
@oleiade oleiade self-assigned this Apr 14, 2023
@oleiade oleiade force-pushed the refactor/ensure-bytes-are-copied branch from cc7e87e to bb7862f Compare April 14, 2023 09:28
@oleiade oleiade force-pushed the refactor/ensure-bytes-are-copied branch from bb7862f to d6bcbae Compare April 14, 2023 09:28
@oleiade oleiade merged commit 37b7ff4 into main Apr 14, 2023
3 checks passed
@oleiade oleiade deleted the refactor/ensure-bytes-are-copied branch April 14, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure to actually copy bytes when the specification requests it
3 participants