-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FABN-909] Move hash classes into fabric-common
fabric-client contains a file called hash.js that exports a set of things: - classes named hash_* that implement the Hash interface - functions named SHA_* that take data in and return a hash - shake_256 The hash_* classes are only used in a couple of places outside of this file, and they would be better off using the SHA_* functions instead. hash_sha3_256 and hash_sha3_384 are not used anywhere, and cannot be used by external code as they are not listed in the CryptoAlgorithms constants, so they can be removed safely. The SHA3_* functions are used and must stay. shake_256 is not used anywhere, and again cannot be used by external code as it is not listed in the CryptoAlgorithms constants, so remove that as well. Also, it has a TODO on it! TL;DR - move hash_sha2_256 and hash_sha2_384 into fabric-common, export the SHA_* functions via a HashPrimitives object, and use that everywhere. Also had to add an encoding flag to the SHA2_* functions to allow them to return Buffer objects as required in several places (instead of hex strings). Change-Id: I7fd2730d73109412cd9ddab4c9e32fec34b47321 Signed-off-by: Simon Stone <[email protected]>
- Loading branch information
Simon Stone
committed
Jan 23, 2019
1 parent
0575ff7
commit 317ed37
Showing
18 changed files
with
391 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.