Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
crypto: add outputLength option to crypto.createHash #28805
This change adds a
There are two important differences to the OpenSSL API here:
If someone sees a problem with either of these API differences, please let me know so we can find a solution.
I had a hard time debugging some segmentation faults on certain platforms and finally tracked it down to the assembly code behind OpenSSL's
I approved, but I wonder whether
@mscdex I think "digestSize" has the same problem as "hashSize", since "digest" and "hash" are pretty much synonomous. Its not clear if its the size of the digest algorithm, or of the digest output. Do you find "outputSize" unclear? I'm not wedded to it, maybe there is a better name.
@sam-github That's a very valid question. Technically, XOFs don't even qualify as hash functions according to NIST FIPS 202:
So NIST certainly won't call the output a "hash". However, they also make it clear that the numbers in the names of the function do not refer to the "digest lengths":
If we pretend that XOFs are hash functions, then