Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idiomatic code & usage #6

Open
burdges opened this issue Apr 11, 2024 · 0 comments
Open

Idiomatic code & usage #6

burdges opened this issue Apr 11, 2024 · 0 comments

Comments

@burdges
Copy link

burdges commented Apr 11, 2024

The code is not so idiomatic for rust cryptography code:

  • Unecessary Vecs abound. Arkworks needs alloc anyways, but Vecs are still jarring, and likely leave secrets in the heap, where stack usage tends to whipe them for free.
  • serde is used, which is controversial: 1, 2, 3.

Around the Vecs: Why does the GAffine enum exist? Is drand producing curve points on both G1 and G2? I suppose drand must do so, since you provide hashes to both G1 and G2, but why does drand do this?

Also..

If you want time lock encryption, then you often want proofs of correctness too. It's extremely complext doing so once an AEAD enters the picture, so likely people employ a simpler trick: hash the pairing to create another secret key usk for which you reveal its public key upk early, reveal their secret r for early decryption, and retroactively invalidate participation in the protocol if upk does not match the tlock pairing output usk, as derived either from r or the tlock expiring. I realize this is not what the drand tlock paper does, but it's the cheapest proofs of correctness for those who require one.

As is, it's maybe easier if drand tlock users fork and/or re-implement this, using their specific situation, so maybe the easiest solution to all of this is simply add a few comments to the code that reference whatever spec drand or whatever is working off here? In particular how the G1 and/or G2 evaluation comes from drand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant