Skip to content

WASM: Add SHA* hash functions - #40486

Merged
akoeplinger merged 1 commit into
dotnet:masterfrom
akoeplinger:wasm-hash-functions
Sep 2, 2020
Merged

akoeplinger merged 1 commit into
dotnet:masterfrom
akoeplinger:wasm-hash-functions

Conversation

@akoeplinger

@akoeplinger akoeplinger commented Aug 6, 2020 •

Copy link
Copy Markdown
Member

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

ghost commented Aug 6, 2020

Copy link
Copy Markdown

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

Comment thread src/mono/mono/utils/mono-md5.c Resolved
@jkotas
jkotas requested a review from blowdart August 6, 2020 21:47
@blowdart

blowdart commented Aug 6, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

@bfmsoft

bfmsoft commented Aug 27, 2020

Copy link
Copy Markdown

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

GrabYourPitchforks commented Sep 1, 2020 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member Author

/backport to release/5.0-rc2

@github-actions

github-actions Bot commented Sep 2, 2020

Copy link
Copy Markdown
Contributor

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