HomePhabricator

[ecash-lib] Add SHA512 support, hashers and `Hmac`

Description

[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

Details

Provenance
tobias_ruckAuthored on Thu, Jan 30, 01:49
teamcityPushed on Thu, Jan 30, 09:46
Parents
rSTAGING8379d6a7bf1a: [doc] Rename some spec file to remove the activation date
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/52454, tag: phabricator/base/52452

Event Timeline