// Generated by build/codegen_ecp_factory.sh
// Mon Mar 20 15:05:35 UTC 2023

#ifndef __ZEN_BIG_TYPES_H__
#define __ZEN_BIG_TYPES_H__
#include <arch.h>

#include <fp12_BLS381.h>
// cascades includes for big_ fp_ fp2_ and fp4_

#define BIG BIG_384_29

// from milagro's pair_BLS381.h
extern void PAIR_BLS381_GTpow(FP12_BLS381 *x,BIG_384_29 b);


// instance is in rom_field_XXX.c and included by fp_XXX.h
/* #define Modulus Modulus_BLS381
#define CURVE_Gx CURVE_Gx_BLS381
#define CURVE_Gy CURVE_Gy_BLS381
		 // 0x73435FD from rom_field_BLS383 at 32bit
*/

#define Montgomery MConst_BLS381

// CHUNK is 32bit

#define BIG  BIG_384_29
#define DBIG DBIG_384_29
#define MODBYTES MODBYTES_384_29
#define BIGLEN NLEN_384_29
#define DBIGLEN DNLEN_384_29
#define BIG_zero(b) BIG_384_29_zero(b)
#define BIG_fromBytesLen(b,v,l) BIG_384_29_fromBytesLen(b,v,l)
#define BIG_iszilch(b) BIG_384_29_iszilch(b)
#define BIG_diszilch(b) BIG_384_29_diszilch(b)
#define BIG_inc(b,n) BIG_384_29_inc(b,n)
#define BIG_dec(b,n) BIG_384_29_dec(b,n)
#define BIG_norm(b) BIG_384_29_norm(b)
#define BIG_nbits(b) BIG_384_29_nbits(b)
#define BIG_copy(b,a) BIG_384_29_copy(b,a)
#define BIG_rcopy(b,a) BIG_384_29_rcopy(b,a)
#define BIG_shl(b,a) BIG_384_29_shl(b,a)
#define BIG_shr(b,a) BIG_384_29_shr(b,a)
#define BIG_fshl(b,a) BIG_384_29_fshl(b,a)
#define BIG_fshr(b,a) BIG_384_29_fshr(b,a)
#define BIG_dshl(b,a) BIG_384_29_dshl(b,a)
#define BIG_dshr(b,a) BIG_384_29_dshr(b,a)
#define BIG_parity(b) BIG_384_29_parity(b)
#define BIG_isunity(b) BIG_384_29_isunity(b)
#define BIG_toBytes(b,a) BIG_384_29_toBytes(b,a)
#define BIG_comp(l,r) BIG_384_29_comp(l,r)
#define BIG_add(d,l,r) BIG_384_29_add(d,l,r)
#define BIG_sub(d,l,r) BIG_384_29_sub(d,l,r)
#define BIG_mul(d,l,r) BIG_384_29_mul(d,l,r)
#define BIG_imul(d,l,r) BIG_384_29_imul(d,l,r)
#define BIG_pmul(d,l,r) BIG_384_29_pmul(d,l,r)
#define BIG_mod(x,n) BIG_384_29_mod(x,n)
#define BIG_invmodp(x,y,n) BIG_384_29_invmodp(x,y,n)
#define BIG_monty(d,m,c,s) BIG_384_29_monty(d,m,c,s)
// #define BIG_dmod(a,b,c) BIG_384_29_dmod(a,b,c)
#define BIG_sdiv(x,n) BIG_384_29_sdiv(x,n)
#define BIG_ddiv(d,l,r) BIG_384_29_ddiv(d,l,r)
#define BIG_modmul(x,y,z,n) BIG_384_29_modmul(x,y,z,n)
#define BIG_moddiv(x,y,z,n) BIG_384_29_moddiv(x,y,z,n)
#define BIG_modsqr(x,y,n) BIG_384_29_modsqr(x,y,n)
#define BIG_modneg(x,y,n) BIG_384_29_modneg(x,y,n)
#define BIG_jacobi(x,y) BIG_384_29_jacobi(x,y)
#define BIG_random(m,r) BIG_384_29_random(m,r)
#define BIG_randomnum(m,q,r) BIG_384_29_randomnum(m,q,r)

#define BIG_sqr(x,y) BIG_384_29_sqr(x,y);
#define BIG_dcopy(d,s) BIG_384_29_dcopy(d,s)
#define BIG_sducopy(d,s) BIG_384_29_sducopy(d,s)
#define BIG_sdcopy(d,s) BIG_384_29_sdcopy(d,s)
#define BIG_dnorm(x) BIG_384_29_dnorm(x)
#define BIG_dcomp(l,r) BIG_384_29_dcomp(l,r)
#define BIG_dscopy(d,s) BIG_384_29_dscopy(d,s)
#define BIG_dsub(d,l,r) BIG_384_29_dsub(d,l,r)
#define BIG_dadd(d,l,r) BIG_384_29_dadd(d,l,r)
#define BIG_dmod(d,l,r) BIG_384_29_dmod(d,l,r)
#define BIG_dfromBytesLen(d,o,l) BIG_384_29_dfromBytesLen(d,o,l)
#define BIG_dzero(d) BIG_384_29_dzero(d)
#define BIG_dnbits(d) BIG_384_29_dnbits(d)

#define FP FP_BLS381
#define FP_nres(f,b) FP_BLS381_nres(f,b)
#define FP_copy(d,s) FP_BLS381_copy(d,s)
#define FP_redc(x,y) FP_BLS381_redc(x,y)
#define FP_reduce(x) FP_BLS381_reduce(x)
#define FP_mod(d,s) FP_BLS381_mod(d,s)

#define FP12 FP12_BLS381
// #define FP12_zero(b) FP12_BLS381_zero(b)
#define FP12_copy(d,s) FP12_BLS381_copy(d,s)
#define FP12_eq(l,r) FP12_BLS381_equals(l,r)
// #define FP12_cmove(d,s,c) FP12_BLS381_cmove(d,s,c)
#define FP12_fromOctet(f,o) FP12_BLS381_fromOctet(f,o)
#define FP12_toOctet(o,f) FP12_BLS381_toOctet(o,f)
#define FP12_mul(l, r) FP12_BLS381_mul(l, r)
// #define FP12_imul(d, l, r) FP12_BLS381_imul(d, l, r)
#define FP12_sqr(d, s) FP12_BLS381_sqr(d, s)
// #define FP12_add(d, l, r) FP12_BLS381_add(d, l, r)
// #define FP12_sub(d, l, r) FP12_BLS381_sub(d, l, r)
#define FP12_div2(d, s) FP12_BLS381_div2(d,s)
#define FP12_GTpow(x, b) PAIR_BLS381_GTpow(x,b)
// #define FP12_pinpow(r, x, b) FP12_BLS381_pinpow(r,x,b)

// #define FP12_sqrt(d,s) FP12_BLS381_sqrt(d,s)
// #define FP12_neg(d,s) FP12_BLS381_neg(d,s)
// #define FP12_reduce(f) FP12_BLS381_reduce(f)
// #define FP12_norm(f) FP12_BLS381_norm(f)
// #define FP12_qr(f) FP12_BLS381_qr(f)
#define FP12_inv(d,s) FP12_BLS381_inv(d,s)

#endif // _H_
