-
Notifications
You must be signed in to change notification settings - Fork 204
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
missing several variations of sha2 #205
Comments
Some additional clarifications that @aschmahmann pointed out:
https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf contains the specifications for all of these functions. I found Section 5.3 particularly illuminating on the distinctness of internal constants for these hashes. |
👍 these are all fine by me, with the names as you've listed them which would match conventions already established. Re your naming notes:
Re numbering: probably lower down in the numbering because I doubt these are going to be as common as 256 and plain 512 (not sure about 384, maybe the jury is still out on that?). I started |
Agree on SHA2 naming being something of a mess in the common parlance. It confuses me enough that I re-check the wikipedia entry every time I talk about this subject, to make sure I'm not going insane. 🙃 I'll propose a diff with this naming and the variations going in the last column for clarity and search. 👍 👍 I'm definitely going to campaign hard for SHA-384 to get a low, single-byte number. Per the combination of the language availability notes and the comparison table above: SHA-384 is the only hash function that's widely available in the browser today while also having some modicum of built-in resilience to length-extension attacks. I would go so far as to say we should make SHA-384 the default hash function we use in any of our example material. (n.b., "default in example material", not default in the sense of what libraries do with no inputs; most of our libraries don't have that opinionated of defaults.) |
The multiformats table seems to be missing several variations of sha2. Specifically:
See the excellent comparison chart in Wikipedia for more details here: https://en.wikipedia.org/wiki/SHA-2#Comparison_of_SHA_functions
Or I've lifted just the most relevant rows in a screenshot here for ease of reference:
I'm especially interested in getting sha2-384 into the table, because it's both widely available and offers some innate defenses against length extension attacks (unlike the sha2 variants we currently have in the table, which both offer none!). But all four of these are well-standardized and deserve an indicator number in the multiformats table.
Naming notes:
Language library availability notes:
In golang, all of these are available in the standard library (as
sha256.New224
,sha512.New384
,sha512.New512_224
, andsha512.New512_256
respectively).In javascript, in the browser, taking the Mozilla docs for SubtleCrypto.digest as a reference, SHA-384 is widely available.
I'll file a PR for this soon, but first, a couple questions:
The text was updated successfully, but these errors were encountered: