davidben / merkle-tree-certs

Other
9 stars 4 forks source link

Simplify hashing by not padding to hash block size #73

Closed bwesterb closed 1 year ago

bwesterb commented 1 year ago

Hashing is very fast already: we do not need the speed up, and the padding made it a bit harder to implement.

GH #72

davidben commented 1 year ago

Hashing is very fast already

In other words, never use MTCs with SHA-3? 😉

davidben commented 1 year ago

Probably the right padding construction would be

struct {
    opaque issuer_id<1..32>;
    uint32 batch_number;
    opaque pad[N];
    uint8 distinguisher = ...;
    ...

That way you can feed the first block into your hash context once and then clone the hash context for all the subsequent bits. Previously we needed to freeze three different ones.

bwesterb commented 1 year ago

In other words, never use MTCs with SHA-3? 😉

shush!