Skip to content

Latest commit

 

History

History

bn_curves

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Barreto-Naehrig Curves

Overview

This module provides functionality to construct Barreto-Naehrig (BN) curves, following the procedure described in [BN05]. The module contains three files:

  • bn_curves.py, which contains the algorithm to construct Barreto-Naehrig curves;

  • bn_curves_examples.py, which contains code examples;

  • bn_curves_tests.py, which contains unit tests.

Throughout, q denotes the prime size of the base field; t denotes the trace of Frobenius; r denotes the prime size of the group; k denotes the embedding degree; D denotes the (negative) fundamental discriminant.

Methods

The main method in bn_curves.py is

make_curve(num_bits, num_curves=1)

It outputs a list of the first num_curves BN curves of prime order at least 2num_bits.

Examples

The code example in bn_curves_examples.py shows how to find 10 BN curves with a prime order that is at least 2100.

Tests

The test in bn_curves_tests.py runs the algorithm on random bit-sizes and checks validity of the output.