#pairing #eip1962 #big #integer #representation #derivation #fixed

macro eth_pairings_repr_derive

Fixed size big integer representation derivation macro

1 unstable release

0.1.0 Jul 11, 2019

#40 in #derivation


Used in eth_pairings

Apache-2.0

20KB
485 lines

Status

This Rust implementation of EIP1962 is complete to the large extend. If course it's possible to polish further (e.g. make it no_std compatible), but largest part is done:

Features:

  • Fields implementation
  • Weierstrass curves implementation
    • a = 0
    • generic case (a != 0, b != 0)
  • Extension towers
    • Fp2
    • Fp3
    • Fp4 as 2 over 2
    • Fp6 as 2 over 3
    • Fp6 as 3 over 2
    • Fp12 as 2 over 3 over 2
  • Pairings
    • BLS12 curves family
    • BN family
    • MNT6 family
    • MNT4 family
    • Cocks-Pinch method generated curves in Weierstrass form (Ate pairing) with k=6

Testing:

  • Basic properties are tested during development (whitebox testing) in a form of e.g. bilinearity checks for pairings
  • Fuzzy testing in cross-checks mode with C++ and Go implementations that catches both crashes in any of the libraries and tests for a consistent output (for consensus purposes)
    • During such testing most of the checks are disabled, e.g. points are allowed to be not on the curve cause it would be difficult for a fuzzer to find a proper test vector. So such testing covers more edge cases then would be possible in production

Documentation about EIP1962

See documentation folder for a complete description and the single source of truth about EIP.

Original proposal

Original EIP is here

Contributors

Resources to consult and use

Dependencies

~2.5MB
~60K SLoC