PBC库传入参数文件问题
来源:互联网 发布:iwatch3蜂窝网络 编辑:程序博客网 时间:2024/05/20 05:55
配置不同类型的椭圆曲线,需要修改配对类型。
PBC的param目录下有好多种:
PBC手册是这样写的
Chapter 5. Param functions
Pairings are initialized from pairing parameters, which are objects of type pbc_param_t. Some applications can ignore this data type because pairing_init_set_str() handles it behind the scenes:it reads a string as a pbc_param_t, then initializes a pairing with these parameters.- int pbc_param_init_set_str(pbc_param_t par, const char *s)
- int pbc_param_init_set_buf(pbc_param_t par, const char *s, size_t len)
Same, but read at most len bytes. If len is 0, it behaves as the previous function. Returns 0 if successful,
- void pbc_param_out_str(FILE *stream, pbc_param_t p)
- void pbc_param_clear(pbc_param_t p)
可以使用的有以下三种:
(1)Windows下直接调用的只有A,D,F三种类型的曲线
pairing_t pairing;a_param_input(pairing);
(2)产生动态配参数
pairing_t pairing;a_param_t w;a_param_init(w);a_param_gen(w,160,512);//取160bit,512bit最佳pairing_init_a_param(pairing,w);(3)自己写的一个pbc_new.h头文件
#include <stdio.h>#include "pbc.h"static inline void pbc_demo_pairing_init(pairing_t pairing, char* filename) { char s[16384]; FILE *fp; unsigned int count;fp = fopen(filename, "r"); if (!fp){ printf("error opening %s", filename); } count = fread(s, 1, 16384, fp); if (!count){ printf("input error"); } fclose(fp); pairing_init_inp_buf(pairing, s, count); }主函数main()里的调用代码:
#define F_PATH "d:\\a.param" 我放在D盘根目录下//char* c_filepath = "d:\\a.param"; pbc_demo_pairing_init(pairing, F_PATH); //pbc_new.h
0 0
- PBC库传入参数文件问题
- 布局文件传入参数
- WinMain参数传入问题
- mybatis传入map参数之后xml文件中取值问题
- 给js文件传入参数
- Mybatis多参数传入问题
- MyBatis传入参数的问题
- MyBatis传入参数的问题
- MyBatis传入参数的问题
- MyBatis传入参数的问题
- MyBatis传入参数的问题
- vc 调用win32程序 参数传入问题
- C中函数传入参数不确定问题
- 弹出类提示框传入参数问题
- linux中线程传入参数问题
- MyBatis传入多个参数的问题
- MyBatis传入多个参数的问题
- MyBatis传入多个参数的问题
- Myeclipse详细使用教程
- MyBatis--注解式开发
- FZU 2150 Fire Game (双起点BFS)
- 使用CharacterController控制行走(包括键盘和虚拟杠)
- redis密码设定
- PBC库传入参数文件问题
- WebService 的创建,部署和使用
- JAVA监视某文件夹并对文件夹里的文件做操作
- 数十种TensorFlow实现案例汇集:代码+笔记
- struts2之日期类型转换
- Yaf学习之控制器
- 实现一个简单的栅格系统
- [LeetCode]53. Maximum Subarray
- Linux下编译C语言程序