gnark-crypto icon indicating copy to clipboard operation
gnark-crypto copied to clipboard

Feat: Add Schnorr signature scheme

Open yelhousni opened this issue 2 years ago • 2 comments

yelhousni avatar Jan 25 '23 16:01 yelhousni

@yelhousni - actually, maybe we could change interfaces such that the hash functions are a property of the key, not runtime parameter to Sign and Verify. So, when we have schnorr.GenerateKey then we feed all the properties we want (hash function H1, H2 etc.) and then later just call pk.Sign(msg) and vk.Verify(sig, msg). We could also embed the information in the marshalled keys and so when unmarshalling all the properties are also applied.

I think this is also a bit more future-proof as for example RSA has a lot of parameters you can tweak (not that we want to get into RSA-land, but just in case) and it really doesn't make sense to pass them manually around everywhere. And if we do not pass any options when generating the keys, then we choose defaults (e.g. SHA256 for ECDSA etc.). Does it makes sense? If so, then I would create a new issue to design it further.

ivokub avatar Jan 30 '23 15:01 ivokub

Does it makes sense? If so, then I would create a new issue to design it further.

Yup that makes sense.

yelhousni avatar Jan 30 '23 15:01 yelhousni