datrs / merkle-tree-stream

A stream that generates a merkle tree based on the incoming data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make merkle-tree-stream generic over hash types

yoshuawuyts opened this issue · comments

commented

Right now a hash is always a buffer. This is not ideal because before comparing we need to cast it back to the original Hash type to ensure that we have constant-time comparisons (which is an essential security feature).

Therefore I propose we make this module a generic over a Hash type so we can get away with fewer conversions. Thanks!

commented

Maybe we should even make the Node types generic. We can provide a default implementation, but it's super useful to be able to extend them with custom traits.

commented

This has been done!