import { SmartContractLib } from 'scrypt-ts'; export type FQ = bigint; export type FQ2 = { x: FQ; y: FQ; }; export type FQ6 = { x: FQ2; y: FQ2; z: FQ2; }; export type FQ12 = { x: FQ6; y: FQ6; }; export type CurvePoint = { x: FQ; y: FQ; z: FQ; t: FQ; }; export type TwistPoint = { x: FQ2; y: FQ2; z: FQ2; t: FQ2; }; export type G1Point = { x: FQ; y: FQ; }; export type G2Point = { x: FQ2; y: FQ2; }; export declare class BN256 extends SmartContractLib { static readonly CURVE_BITS = 256; static readonly CURVE_BITS_P8 = 264; static readonly CURVE_BITS_P8_DIV12 = 88; static readonly S = 33; static readonly UB = 368; static readonly G1: CurvePoint; static readonly G2: TwistPoint; static readonly FQ2Zero: FQ2; static readonly FQ2One: FQ2; static readonly FQ6Zero: FQ6; static readonly FQ6One: FQ6; static readonly FQ12Zero: FQ12; static readonly FQ12One: FQ12; static readonly P: bigint; static readonly xiToPMinus1Over6: FQ2; static readonly xiTo2PMinus2Over3: FQ2; static readonly xiToPMinus1Over2: FQ2; static readonly xiToPMinus1Over3: FQ2; static readonly xiTo2PSquaredMinus2Over3: FQ; static readonly xiToPSquaredMinus1Over3: FQ; static readonly xiToPSquaredMinus1Over6: FQ; static compareFQ2(a: FQ2, b: FQ2): boolean; static compareFQ6(a: FQ6, b: FQ6): boolean; static compareFQ12(a: FQ12, b: FQ12): boolean; static compareCurvePoints(a: CurvePoint, b: CurvePoint): boolean; static compareTwistPoints(a: TwistPoint, b: TwistPoint): boolean; static modReduce(x: bigint, modulus: bigint): bigint; static modFQ2(t0: FQ2): FQ2; static modFQ12(t0: FQ12): FQ12; static modCurvePoint(t0: CurvePoint): CurvePoint; static modTwistPoint(t0: TwistPoint): TwistPoint; static mulFQ2(a: FQ2, b: FQ2): FQ2; static mulXiFQ2(a: FQ2): FQ2; static mulScalarFQ2(a: FQ2, scalar: bigint): FQ2; static addFQ2(a: FQ2, b: FQ2): FQ2; static subFQ2(a: FQ2, b: FQ2): FQ2; static negFQ2(a: FQ2): FQ2; static conjugateFQ2(a: FQ2): FQ2; static doubleFQ2(a: FQ2): FQ2; static squareFQ2(a: FQ2): FQ2; static modInverseBranchlessP(x: bigint): bigint; static modInverseEGCD(x: bigint, m: bigint): bigint; static inverseFQ2(a: FQ2): FQ2; static mulFQ6(a: FQ6, b: FQ6): FQ6; static doubleFQ6(a: FQ6): FQ6; static mulScalarFQ6(a: FQ6, scalar: FQ2): FQ6; static addFQ6(a: FQ6, b: FQ6): FQ6; static subFQ6(a: FQ6, b: FQ6): FQ6; static negFQ6(a: FQ6): FQ6; static squareFQ6(a: FQ6): FQ6; static mulTauFQ6(a: FQ6): FQ6; static inverseFQ6(a: FQ6): FQ6; static mulScalarFQ12(a: FQ12, scalar: FQ6): FQ12; static inverseFQ12(a: FQ12): FQ12; static mulFQ12(a: FQ12, b: FQ12): FQ12; static frobeniusFQ6(a: FQ6): FQ6; static frobeniusP2FQ6(a: FQ6): FQ6; static mulGFP(a: FQ6, b: bigint): FQ6; static conjugateFQ12(a: FQ12): FQ12; static frobeniusFQ12(a: FQ12): FQ12; static frobeniusP2FQ12(a: FQ12): FQ12; static squareFQ12(a: FQ12): FQ12; static expFQ12_u(a: FQ12): FQ12; static expFQ12(a: FQ12, power: bigint): FQ12; static doubleG1Point(a: G1Point): G1Point; static doubleCurvePoint(a: CurvePoint): CurvePoint; static addG1Points(a: G1Point, b: G1Point): G1Point; static addCurvePoints(a: CurvePoint, b: CurvePoint): CurvePoint; static _addCurvePoints(P: bigint, a: CurvePoint, b: CurvePoint): CurvePoint; static mulG1Point(a: G1Point, m: bigint): G1Point; static mulCurvePoint(a: CurvePoint, m: bigint): CurvePoint; static makeAffineCurvePoint(a: CurvePoint): CurvePoint; static negCurvePoint(a: CurvePoint): CurvePoint; static isInfCurvePoint(a: CurvePoint): boolean; static createCurvePoint(ccp: G1Point): CurvePoint; static getG1Point(cp: CurvePoint): G1Point; static doubleG2Point(a: G2Point): G2Point; static doubleTwistPoint(a: TwistPoint): TwistPoint; static addG2Points(a: G2Point, b: G2Point): G2Point; static addTwistPoints(a: TwistPoint, b: TwistPoint): TwistPoint; static makeAffineTwistPoint(a: TwistPoint): TwistPoint; static negTwistPoint(a: TwistPoint): TwistPoint; static isInfTwistPoint(a: TwistPoint): boolean; static createTwistPoint(ctp: G2Point): TwistPoint; static getG2Point(tp: TwistPoint): G2Point; } export type LineFuncRes = { a: FQ2; b: FQ2; c: FQ2; rOut: TwistPoint; }; export declare class BN256Pairing extends SmartContractLib { static compareLineFuncRes(a: LineFuncRes, b: LineFuncRes): boolean; static modLineFuncRes(l: LineFuncRes): LineFuncRes; static lineFuncAdd(r: TwistPoint, p: TwistPoint, q: CurvePoint, r2: FQ2): LineFuncRes; static lineFuncDouble(r: TwistPoint, q: CurvePoint): LineFuncRes; static mulLine(ret: FQ12, a: FQ2, b: FQ2, c: FQ2): FQ12; static miller(q: TwistPoint, p: CurvePoint): FQ12; static finalExponentiation(a: FQ12): FQ12; static _pair(g1: CurvePoint, g2: TwistPoint): FQ12; static pair(g1: G1Point, g2: G2Point): FQ12; static _pairCheckP4Precalc(a0: CurvePoint, b0: TwistPoint, millerBetaAlpha: FQ12, a2: CurvePoint, b2: TwistPoint, a3: CurvePoint, b3: TwistPoint): boolean; static pairCheckP4Precalc(a0: G1Point, b0: G2Point, millerBetaAlpha: FQ12, a2: G1Point, b2: G2Point, a3: G1Point, b3: G2Point): boolean; static _pairCheckP2Precalc(a0: CurvePoint, b0: TwistPoint, a1: CurvePoint, b1: TwistPoint): boolean; static pairCheckP2Precalc(a0: G1Point, b0: G2Point, a1: G1Point, b1: G2Point): boolean; }