Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

feat: update representation-independent hash computation #240

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Oct 17, 2023

This MR updates the specification of the representation-independent hash computation for the case of maps with nested maps.

@mraszyk mraszyk requested a review from a team as a code owner October 17, 2023 07:46
@adamspofford-dfinity
Copy link

adamspofford-dfinity commented Oct 20, 2023

Should it not be the other way around, H(key) . hash_of_map(...)? It seems inconsistent that arrays are hashed once but maps are hashed twice. (Plus if there's a double hash it can no longer be implemented as a single stateless serde serializer.)

@mraszyk mraszyk changed the title fix: make verify_signature computation more explicit feat: update representation-independent hash computation Oct 24, 2023
@mraszyk
Copy link
Contributor Author

mraszyk commented Oct 24, 2023

Should it not be the other way around, H(key) . hash_of_map(...)? It seems inconsistent that arrays are hashed once but maps are hashed twice. (Plus if there's a double hash it can no longer be implemented as a single stateless serde serializer.)

Sounds good! I've updated the PR and its example computation to reflect your suggestion.

Copy link
Member

@Dfinity-Bjoern Dfinity-Bjoern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, looks good, thanks @mraszyk!

@mraszyk mraszyk merged commit 76af809 into master Nov 1, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants