-
Notifications
You must be signed in to change notification settings - Fork 60
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
Implement sha512-256 and sha512-224 #67
base: master
Are you sure you want to change the base?
Conversation
Older don't have sha512-256 and sha512-224, but they should get tested.
cc @dcousens |
ping @dcousens |
LGTM, maybe @ForbesLindesay can merge it for you |
@ForbesLindesay does this PR also look good to you? |
@jprichardson @calvinmetcalf @fanatid any chance this PR has a viable path towards being merged? Or is it as dead as a doornail. |
. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for 1 comment about the test. I can merge it but only @calvinmetcalf can make npm release.
tape("hash is the same as node's crypto for all algos provided by node", function (t) { | ||
var hashes = crypto.getHashes() | ||
Object.keys(sha).forEach(function (alg) { | ||
if (hashes.indexOf(alg) === -1) return // skip unsupported by current Node.js version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really test newly added sha512-224
/ sha512-256
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As crypto-browserify doesn't support sha512/256 yet. See browserify/sha.js#67
As crypto-browserify doesn't support sha512/256 yet. See browserify/sha.js#67
As crypto-browserify doesn't support sha512/256 yet. See browserify/sha.js#67
As crypto-browserify doesn't support sha512/256 yet. See browserify/sha.js#67
As crypto-browserify doesn't support sha512/256 yet. See browserify/sha.js#67
Basically, the same relationship as between sha256 and sha224 -- I copied that approach.
Simple tests included that it matches Node.js impl, but there are no other test vectors due to test organization (vectors are in a separate package).