⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pbc_d_param.h

📁 这是一个C的源代码
💻 H
字号:
// requires// * stdio.h// * gmp.h// * mnt.h// * fops.h// * pairing.h#ifndef __PBC_D_PARAM_H__#define __PBC_D_PARAM_H__struct d_param_s {    mpz_t q; //curve defined over F_q    mpz_t n; //has order n (= q - t + 1) in F_q    mpz_t h; //h * r = n, r is prime    mpz_t r;    mpz_t a, b; //curve equation is y^2 = x^3 + ax + b    int k; //embedding degree    mpz_t nk; //order of curve over F_q^k    mpz_t hk; //hk * r^2 = nk    mpz_t *coeff; //coefficients of polynomial used to extend F_q by k/2    mpz_t nqr; //a quadratic nonresidue in F_q^d that lies in F_q};typedef struct d_param_s d_param_t[1];typedef struct d_param_s *d_param_ptr;/*@manual dparamInitialize ''p''. This must be called before ''p'' can be used.*/void d_param_init(d_param_ptr p);/*@manual dparamClear ''p''. This should be called after ''p'' is no longer needed.*/void d_param_clear(d_param_ptr p);/*@manual dparamWrite the parameters in ''p'' in a text format onto ''stream''.*/void d_param_out_str(FILE *stream, d_param_ptr p);void d_param_inp_generic (d_param_ptr p, fetch_ops_t fops, void *ctx);void pairing_init_d_param(pairing_t pairing, d_param_t param);static inline void d_param_init_inp_str(d_param_ptr p, FILE *stream){    d_param_init(p);    d_param_init_inp_str(p, stream);}/*@manual dparamType D curves are generated using thecomplex multiplication (CM) method.This function sets ''p'' toa type D pairing parameters from CM parameters ''cm''.Another part of the library searches forappropriate CM parameters (see below)and the results can be passed to this function.</para><para>To be secure, generic discrete log algorithms mustbe infeasible in groups of order r, and finite field discrete log algorithmsmust be infeasible in finite fields of order q^6.For usual CM parameters, r is a few bits smaller than q.*/void d_param_from_cm(d_param_t p, cm_info_ptr cm);#endif //__PBC_D_PARAM_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -