#include <stdio.h>
#include <pbc.h>
struct darray_s {
void **item;
int count;
int max;
};
typedef struct darray_s darray_t[1];
typedef struct darray_s *darray_ptr;
typedef struct {
// The coefficients are held in a darray which is resized as needed.
// The last array entry represents the leading coefficient and should be
// nonzero. An empty darray represents 0.
darray_t coeff;
} *peptr;
// 摘自pbc庫中F參數定義
struct f_param_s {
mpz_t q; // Curve defined over F_q.
mpz_t r; // The order of the curve.
mpz_t b; // E: y^2 = x^3 + b
mpz_t beta; //beta is a quadratic nonresidue in Fq
//we use F_q^2 = F_q[sqrt(beta)]
mpz_t alpha0, alpha1;
//the polynomial x^6 + alpha0 + alpha1 sqrt(beta)
//is irreducible over F_q^2[x], so
//we can extend F_q^2 to F_q^12 using the
//sixth root of -(