-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This makes three actual changes: 1. change the hash function from SHA256 2. don't bother using xor, just include things into what we hash 3. serialise the slot number using raw serialisation, not CBOR On 1, SHA256 was just the default suggestion, not a requirement. It's simpler to simply use the same 256bit hash as we use everywhere else. On 2, the original suggestion was to xor the universal constant into the seed. But this suggestion of xor was as a minimum way to mix it in, not a specific requirement. Since at the point where we are mixing it in we are already hashing things, then its simpler to just include it into the hash. So instead of a `xor` hash (b <> c) we can just use hash (a <> b <> c). This also avoids using a slow xor implementation. On 3, we should avoid CBOR serialisation for internal hashing, signing etc. For one thing it's not quick.
- Loading branch information
Showing
3 changed files
with
48 additions
and
14 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