#pairing #crypto

rabe-bn

Pairing cryptography with the Barreto-Naehrig curve. Update to use latest rand and serde crates.

14 releases

Uses old Rust 2015

0.4.20 Mar 21, 2022
0.4.18 Mar 2, 2022
0.4.15 Jan 18, 2022
0.4.13 Jan 25, 2021
0.4.10 Aug 27, 2020

#982 in Cryptography

Download history 1/week @ 2023-12-04 19/week @ 2023-12-18 10/week @ 2024-01-08 76/week @ 2024-01-15 56/week @ 2024-01-22 56/week @ 2024-01-29 69/week @ 2024-02-05 32/week @ 2024-02-12 50/week @ 2024-02-19 13/week @ 2024-02-26 26/week @ 2024-03-04 20/week @ 2024-03-11 45/week @ 2024-03-18

104 downloads per month
Used in rabe

MIT/Apache

175KB
3K SLoC

bn Crates.io Build status

This is a pairing cryptography library written in pure Rust. It makes use of the Barreto-Naehrig (BN) curve construction from [BCTV2015] to provide two cyclic groups G1 and G2, with an efficient bilinear pairing:

e: G1 × G2 → GT

Security warnings

This library, like other pairing cryptography libraries implementing this construction, is not resistant to side-channel attacks.

Usage

Add the bn crate to your dependencies in Cargo.toml...

[dependencies]
rabe-bn = "0.4.20"

If you prefer borsh instead of serde, you may use the borsh feature. Afterwards add an extern crate declaration to your crate root:

extern crate rabe_bn;

API

  • Fr is an element of Fr
  • G1 is a point on the BN curve E/Fq : y^2 = x^3 + b
  • G2 is a point on the twisted BN curve E'/Fq2 : y^2 = x^3 + b/xi
  • Gt is a group element (written multiplicatively) obtained with the pairing function over G1 and G2.

License

Licensed under either of

at your option.

Copyright 2016 Zcash Electric Coin Company. The Zcash Company promises to maintain the "bn" crate on crates.io under this MIT/Apache-2.0 dual license.

Authors

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0.8–1.8MB
~36K SLoC