w3f / schnorrkel

Schnorr VRFs and signatures on the Ristretto group
BSD 3-Clause "New" or "Revised" License
314 stars 93 forks source link

Improve hashing speed #33

Closed burdges closed 5 years ago

burdges commented 5 years ago

We almost always use merlin for hashing, but merlin is not optimized for large amounts of data, thus making SigningTranscript::bytes slow. We should look into blake2x and/or develop a chacha based strobe variant and/or encourage using the SigningTranscript::hash256 method instead. See https://github.com/paritytech/substrate/pull/2415

burdges commented 5 years ago

I've added a warning on the bytes method. We'll add benchmarks eventually and then compare with SimpleTranscript<Shake128> and eventually SimpleTranscript<Blake2x> if https://github.com/RustCrypto/hashes/issues/83 happens.

burdges commented 5 years ago

Aside from either using Blake2x directly or doing a ChaCha variant of STROBE. We could give Keccak STROBE a fast mode, likely along the lines of KangarooTwelve. See https://github.com/debris/tiny-keccak/pull/41

burdges commented 5 years ago

I'm going to close this since the ship sailed and we're using merlin now. :)