davidben / merkle-tree-certs

Other
9 stars 2 forks source link

Simplify hashing by not padding to hash block size #73

Closed bwesterb closed 12 months ago

bwesterb commented 12 months 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 12 months ago

Hashing is very fast already

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

davidben commented 12 months 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 12 months ago

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

shush!