asmcrypto / asmcrypto.js

JavaScript Cryptographic Library with performance in mind.
MIT License
660 stars 182 forks source link

SHA512 not found, while SHA1 and SHA256 are fine. #86

Closed ROTGP closed 8 years ago

ROTGP commented 8 years ago

SHA512 seems to be broken. I've used the minified asmcrypto.js file from the repo, and have also built it myself with npm. Same error. SHA1 and SHA256 are fine, including HMAC variants, hex, bytes, etc. But any reference to SHA512 fails.

<script src='js/asmcrypto.js'></script>

<script>

console.log(asmCrypto.SHA1.hex("foo")); // 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33

console.log(asmCrypto.SHA256.hex("foo")); // 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae

console.log(asmCrypto.SHA512.hex("foo")); // Error. Uncaught TypeError: Cannot read property 'hex' of undefined

console.log(asmCrypto); // SHA1 and SHA256 are listed as functions, but SHA512 is not.

</script>
vibornoff commented 8 years ago

SHA512 isn't build by default.

You can build asmcrypto.js with everything in with:

$ grunt --with ALL

For more precise tuning what to build take a look to the Gruntfile.js.

ROTGP commented 8 years ago

Thanks - problem solved. Great work, by the way.