add bn512.hpp

dev
MITSUNARI Shigeo 7 years ago
parent 73ed13ed68
commit 7b35b6605e
  1. 39
      include/mcl/bn512.hpp

@ -0,0 +1,39 @@
#pragma once
/**
@file
@brief preset class for 512-bit optimal ate pairing over BN curves
@author MITSUNARI Shigeo(@herumi)
@license modified new BSD license
http://opensource.org/licenses/BSD-3-Clause
*/
#include <mcl/bn.hpp>
namespace mcl { namespace bn512 {
namespace local {
struct FpTag;
struct FrTag;
}
typedef mcl::FpT<local::FpTag, 512> Fp;
typedef mcl::bn::BNT<Fp> BN;
typedef BN::Fp2 Fp2;
typedef BN::Fp6 Fp6;
typedef BN::Fp12 Fp12;
typedef BN::G1 G1;
typedef BN::G2 G2;
typedef BN::Fp12 GT;
/* the order of G1 is r */
typedef mcl::FpT<local::FrTag, 512> Fr;
static inline void initPairing(const mcl::bn::CurveParam& cp = mcl::bn::CurveFp254BNb, fp::Mode mode = fp::FP_AUTO)
{
BN::init(cp, mode);
G1::setCompressedExpression();
G2::setCompressedExpression();
Fr::init(BN::param.r);
}
} } // mcl::bn512
Loading…
Cancel
Save