Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bls12381: Add map_to_g2 implementation (#35)
* WIP: Add initial map_to_g2 skeleton * replace psi with correct version, add psi2 * clear_cofactor and subgroup_check for G2 working * initial G1 subgroup check skeleton * Working iso3_map, finished osswu2 but not working * Fix iso3_map den_0/den_1 exception case * Fix osswu2 and get all main tests passing One of the problems seems to be that constant elements (e.g. created with `from_dec`) do not seem to work correctly with some operations. Specifically, the `.neg()` calls for `xi` and `a` were just not doing anything. This needs more investigation. * Finalize missing functions and first cleanup pass * Add assert_is_on_curve for both G1 and G2 * Fix G1 phi endomorphism, subgroup_check, add tests * Update Cargo.toml to enable "experimental" feature for exposing hash_to_g2 stuff in bls12_381 * Fix README link * Remove handful of unnecessary constant allocations * Make sgn0 work for constants and add handful more test cases * Remove debug and commented out code chunks * Remove debug panic!s * Move sgn0 to bellpepper-emulated Also undo the pub(crate) changes * Change default test field to BN256 and limb params This requires a small change in pairing.rs to prevent overflow Also change the default limb counts to 55/7, which gives a significant reduction in constraints for BN256 * Replace FIXME with eprintln! * Lower reductions and remove unnecessary TODOs The TODOs aren't as relevant because the current choice already uses fewer contraints than the alternative * Add docstrings for G1 and G2 functions * Cleanup opt_simple_swu2 and fix lints * Comment out test_random_multi_pairing for CI * Comment out the other pairing test as well * Attempt to run pairing tests in CI again * Attempt to refresh CI * Readd `fail-fast: false` * Add comment to Fp12::square Also fix a few poorly named namespaces * Update expected test results after rebase
- Loading branch information