Merge pull request #11 from hwwhww/blake2b

Added hash function description
This commit is contained in:
Danny Ryan 2018-09-27 07:37:59 -05:00 committed by GitHub
commit 5cfa735482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -443,5 +443,14 @@ Slashing conditions may include:
Proof of custody no secret reveal
RANDAO leak
# Appendix
## Appendix A - Hash function
The general hash function `hash(x)` in this specification is defined as:
`hash(x) := BLAKE2b-512(x)[0:32]`, where `BLAKE2b-512` (`blake2b512`) algorithm is defined in [RFC 7693](https://tools.ietf.org/html/rfc7693) and input `x` is bytes type.
* `BLAKE2b-512` is the *default* `BLAKE2b` algorithm with 64-byte digest size. To get a 32-byte result, the general hash function output is defined as the leftmost `32` bytes of `BLAKE2b-512` hash output.
* The design rationale is keeping using the default algorithm and avoiding too much dependency on external hash function libraries.
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).