arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
770 stars 207 forks source link

Test + Affine SW refactoring #294

Closed jon-chuang closed 3 years ago

jon-chuang commented 3 years ago

Refactored to reduce code duplication, largely using macros. Further, feature gates all tests by type.

The majority of the file changes is happening in 3 files (bn254 and both bls12 field tests) with lots of manual tests that cannot be refactored (3100 loc). In the remainder, we reduce about 1800 loc to about 1400. The major improvement is that a majority of the tests can be controlled by single macros/functions, rather than copy-pasta in 10s of files.


1/3 of a series of PRs to scipr-lab/zexe.

Features:

Combined speedup (with w-NAF) for

Speedup for subgroup verification

jon-chuang commented 3 years ago

@Pratyush do you think we could get this merged? This particular PR is quite straightforward, further, it's been reviewed before on celo-org/zexe

Pratyush commented 3 years ago

Hey @jon-chuang sorry, we've been doing a refactor of the organization of the repo. The algebra related refactor is here. If you could rebase atop that, that would be awesome. Otherwise, porting over the changes to a fresh branch should be straightforward too.

Pratyush commented 3 years ago

Hey @jon-chuang, thanks for the PR! As I mentioned above, we're transitioning the code in this repo over to https://github.com/arkworks-rs/algebra/; could you make the PR there instead? There might be some conflicts because we've broken apart algebra into ark-ff and ark-ec.

Pratyush commented 3 years ago

Hi @jon-chuang do you mind re-opening this PR against arkworks-rs/algebra and against arkworks-rs/curves?

(It'll probably be quite a rework, sorry for the inconvenience!)