facebook / akd

An implementation of an auditable key directory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Investigate simplifying the number of hashing calls done in merkle tree construction

kevinlewi opened this issue · comments

In the merkle tree construction, we are currently doing a lot of hashing. For instance, in build_and_hash_layer(), we are hashing the node label and merging it with the children's hashes. This is probably not necessary, as we can just append the raw node label pre-merge.

Also, we probably do not need to keep re-hashing crate::EMPTY_VALUE or EMPTY_LABEL.

This could lead to a speedup for publish times as we further reduce the total number of hashing calls per publish entry.