James-E-A / pypqc

Attempt to expose Wiggers and Stebila's PQClean via Python CFFI
Other
1 stars 1 forks source link

Test suites #4

Open James-E-A opened 10 months ago

James-E-A commented 10 months ago

PQClean ships with a big ol' bundle of test files; we may as well use them to kick the tires on bdists to fail if they weren't built right

James-E-A commented 10 months ago

Once a test suite's working, I want to see if GitHub allows doing branch protection without GitHub Actions. (Maybe even with, it'd be worth it.)

Idea being, it'd be very professional to make main forced to be a stable branch, so any schmuck can run pip install git+https://… and it'll "just work" (compiler and header and git existence notwithstanding)

James-E-A commented 10 months ago

Side note: some of these algorithms are inherently randomized. Actually, every KEM necessarily is, since it takes only a single argument, the public key, and essentially chooses a random shared secret; Falcon is, too.

Part of the reason behind creating issue #1 was to make it easier to hotwire PQCLEAN_randombytes up with test infrastructure: the idea was that you could just link in your deterministic random function, without having to re-compile the whole library.

However, if resolving issue #1 proves to be too much of a nuisance to reasonably treat it as a blocker for this, then I guess there's no shame in "only" using something like Hypothesis for testing, at least to start out. https://jamiebayne.co.uk/blog/pytest

Also, at least the de-encapsulation and verification test vectors should be usable, even when encapsulation and signatures are randomized.

James-E-A commented 10 months ago

Penciling in Ruff as a code formatter; it might be good to include checks for it in any test suite stuff

James-E-A commented 8 months ago

https://p403n1x87.github.io/running-c-unit-tests-with-pytest.html#coverage-please