[ecash-lib] Add SHA512 support, hashers and Hmac
Summary:
Hmac (hash-based message authentication code) is needed to support mnemonics (for PBKDF2) and HD wallets, such that ecash-lib can be used standalone without other packages to e.g. generate mnemonics and derive HD wallet paths.
For this, we need SHA512 support (HD wallets use it), and we add a simple Hmac class that allows successive updates.
In theory, we could use sha256 and sha512 themselves in the HMAC, however, this will be far too slow in PBKDF2.
Test Plan: npm test
Reviewers: bytesofman, #bitcoin_abc
Reviewed By: bytesofman, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D17609