Commit Graph

20 Commits

Author SHA1 Message Date
Jack Grigg 03f086221b pairing: Move PairingCurveAffine::Prepared to MultiMillerLoop trait
Prepared elements are only used by MultiMillerLoop, and we don't need
the ability to "prepare" G1 elements there.
2020-06-03 20:50:02 +12:00
Jack Grigg b9d6df9133 pairing: Extract Engine::miller_loop into a MultiMillerLoop trait
This enables MultiMillerLoop to be conditionally implemented, for
example in libraries where Engine::pairing supports no-std, but
MultiMillerLoop requires an allocator.
2020-05-31 08:35:02 +12:00
Jack Grigg da2e638c7d pairing: Pass affine references to Engine::pairing 2020-05-31 08:34:07 +12:00
Jack Grigg 57bb18ca6f pairing: Move final_exponentiation into a MillerLoopResult trait 2020-05-31 08:34:03 +12:00
Jack Grigg ec88778258 group: Add scalar multiplication bounds to Group
The Scalar associated type is moved from CurveProjective to Group.
2020-05-15 10:24:30 +12:00
Jack Grigg 69f53febcf group: Introduce Group and PrimeGroup traits
Group represents a cryptographic group with a large prime-order subgroup
and a small cofactor. PrimeGroup further constrains the group to have a
cofactor of one.
2020-05-15 00:20:32 +12:00
Jack Grigg c597db59a6 ff: Rename PrimeField::into_repr -> PrimeField::to_repr 2020-05-02 18:55:13 +12:00
Jack Grigg 1761ebfb35 ff: Remove SqrtField trait
The sqrt() function is now part of the Field trait. ff_derive returns an
error on fields for which it does not support generating a square root
function.

Note that Fq6 and Fq12 in pairing::bls12_381 leave the function
unimplemented. They will be dropped once the migration to the bls12_381
crate is complete. The equivalent structs in that crate are not exposed.
2020-05-02 16:07:48 +12:00
Jack Grigg 49f119fb03 ff: Remove PrimeFieldRepr trait
The ff::PrimeField::Repr associated type now has the minimal necessary
bounds, which can be satisfied by a newtype around a byte array.
2020-04-23 18:15:14 +12:00
Jack Grigg 9c485cc97e Move from CurveProjective::add_assign_mixed to traits 2020-01-13 21:20:46 -05:00
Jack Grigg 8193324986 Move additive CurveProjective operators to traits 2020-01-13 21:19:33 -05:00
Jack Grigg 6c2c2b58de
Migrate pairing benchmarks to criterion 2019-12-19 16:46:16 -06:00
Jack Grigg 40749da9a7
Constant-time field inversion
WARNING: THIS IS NOT ACTUALLY CONSTANT TIME YET!

The jubjub and bls12_381 crates will replace our constant-time usages,
but we NEED to fix ff_derive because other users will expect it to
implement the Field trait correctly.
2019-12-13 19:46:04 +00:00
Jack Grigg cded08b0c5
Make Field::square take &self and return Self 2019-12-12 23:09:28 +00:00
Jack Grigg 91c32f1c7c
Move from Field::negate to Neg operator 2019-12-12 22:52:17 +00:00
Jack Grigg 27c8f34601
Move Field operations to operator-backed traits
The ff_derive, pairing, zcash_primitives::jubjub, and bellman dummy_engine
changes are minimally implemented on top of the existing *_assign()
functions.
2019-12-12 21:19:46 +00:00
Jack Grigg b872e9fc49
Fix pairing benchmarks
They were broken by #91 but went unnoticed because CI does not compile
the benchmarks, which requires the nightly toolchain.
2019-10-08 15:25:41 +13:00
Jack Grigg 794cf79db2
Merge commit '3d41ee5abaa4888ff3607689aba007be8856816d' into ff-traits
git-subtree-dir: pairing
git-subtree-split: 3d41ee5aba
2019-01-06 09:19:29 +00:00
Jack Grigg fe16e4a412
Merge commit '183a64b08e9dc7067f78624ec161371f1829623e' into ff-traits
git-subtree-dir: pairing
git-subtree-split: 183a64b08e
2019-01-06 09:01:44 +00:00
Jack Grigg e924247e73 Add 'pairing/' from commit '09b6e6f9212020f385218e5cf5287e381ccd312b'
git-subtree-dir: pairing
git-subtree-mainline: ad16ba6a35
git-subtree-split: 09b6e6f921
2018-08-28 23:03:42 +01:00