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

WASM: Add SHA* hash functions #40486

Merged
merged 1 commit into from
Sep 2, 2020

Conversation

akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Aug 6, 2020

This ports the managed SHA* hash functions from https://github.com/microsoft/referencesource so we can use them on Browser/WASM where we don't have OpenSSL.

Enables the System.Security.Cryptography.Algorithms tests for these classes: Tests run: 271, Errors: 0, Failures: 0, Skipped: 1. Time: 11.857137s

Resolves #40076

(related: implement this using the web crypto APIs in .NET6: #40074)

@ghost
Copy link

ghost commented Aug 6, 2020

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas requested a review from blowdart August 6, 2020 21:47
@blowdart
Copy link
Contributor

blowdart commented Aug 6, 2020

Seeing as you added me

I question the need for any of this. Is there a driving customer requirement for parity in WASM?

@GrabYourPitchforks GrabYourPitchforks added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 7, 2020
@GrabYourPitchforks
Copy link
Member

Marking this no merge for now while we work through compliance-related details.

@bfmsoft
Copy link

bfmsoft commented Aug 27, 2020

Seeing as you added me

I question the need for any of this. Is there a driving customer requirement for parity in WASM?

Yes, this is needed

@GrabYourPitchforks GrabYourPitchforks added this to the 5.0.0 milestone Aug 31, 2020
@GrabYourPitchforks GrabYourPitchforks removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Sep 1, 2020
@GrabYourPitchforks
Copy link
Member

GrabYourPitchforks commented Sep 1, 2020

Unmarking no merge per email thread from this morning. But please make the requested changes at your convenience. :)

This ports the managed SHA* hash functions from https://github.com/microsoft/referencesource so we can use them on Browser/WASM where we don't have OpenSSL.

Enables the System.Security.Cryptography.Algorithms tests for these classes: `Tests run: 271, Errors: 0, Failures: 0, Skipped: 1. Time: 11.028473s`

Resolves dotnet#40076
@akoeplinger akoeplinger changed the title WASM: Add MD5 and SHA* hash functions WASM: Add SHA* hash functions Sep 2, 2020
@akoeplinger
Copy link
Member Author

Updated the PR:

  • removed MD5, SubtleCrypto doesn't expose MD5 so we wouldn't be able to reimplement it on top of SubtleCrypto in net6
  • added buffering for the input data and call the hashing function in one go, this mimics what we'll have to do with SubtleCrypto in net6

@GrabYourPitchforks GrabYourPitchforks added the arch-wasm WebAssembly architecture label Sep 2, 2020
@akoeplinger akoeplinger merged commit 5183c6e into dotnet:master Sep 2, 2020
@akoeplinger akoeplinger deleted the wasm-hash-functions branch September 2, 2020 21:23
@akoeplinger
Copy link
Member Author

/backport to release/5.0-rc2

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2020

Started backporting to release/5.0-rc2: https://github.com/dotnet/runtime/actions/runs/236751870

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Security
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.NET5 Browser Cryptography Support
7 participants