axelarnetwork / tofn

A threshold cryptography library in Rust
Apache License 2.0
112 stars 23 forks source link

ZkSetupProof should use the PRNG #120

Closed ggutoski closed 3 years ago

ggutoski commented 3 years ago

Currently we sample fresh ephemeral randomness to compute the ZkSetupProof. https://github.com/axelarnetwork/tofn/blob/d5d00ee459e3b921e33a0474831dd465ceddb7e4/src/gg20/crypto_tools/paillier/zk/mod.rs#L50 Thus, we cannot deterministically derive ZkSetupProof from a prng seed. This isn't currently a problem because we currently have no need to deterministically re-derive zk setup info. But it's silly to use the prng only for the keypair portion of the zk setup but not the ZkSetupProof portion.

milapsheth commented 3 years ago

I noticed that the composite dlog proof for the Paillier key pair is also being generated for every share. So, like the Zksetup we should only prove it once, and use the rng to generate it.

milapsheth commented 3 years ago

Based on offline discussion, we agreed that ZkSetup, which is being randomly generated, should use the PRNG (This has been solved in #160. Furthermore, we could make it so that the proof for the Zk setup is also deterministically generated with a PRNG. This part of the issue will be tackled in #163