cfrg / draft-irtf-cfrg-vdaf

VDAF specification
Other
17 stars 14 forks source link

Make proof of concept code pip-installable #359

Open divergentdave opened 1 month ago

divergentdave commented 1 month ago

We should rearrange the directory and module structure of the proof of concept code, and add metadata files (i.e. pyproject.toml or setup.py) to make it installable as a package. This would remove the need for other related drafts to use git submodules and Python import path hacks. I figure we'd want to provide just one top-level module, probably called vdaf, and then move module paths under that. Note that this would require moving around files and rewriting a lot of internal import statements. The goal is that other projects should be able to do pip install git+https://github.com/cfrg/draft-irtf-cfrg-vdaf.git@draft-irtf-cfrg-vdaf-NN#subdirectory=poc, and then import vdaf.

cjpatton commented 1 month ago

Some notes:

  1. We need to make it clear to users that the code is slow and not secure (we don't aim for constant time). If someone wants Python, then they should really just write bindings to libprio.

  2. We currently always invoke the code with sage: what happens if someone tries to pip install this directly?

divergentdave commented 1 month ago

Good point, it would actually be sage -pip install git+https://.... Using pip from a regular Python environment would result in installing the package to the wrong place, and eventually you'd run into trouble at the import sage.all statement.