以下内容源自PBC Library 的 英文manual(Chapter 5)。
本文摘要:
五,Param functions
- 1.1.Param generation
一. 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)
Initializes pairing parameters from the string s. Returns 0 if successful, 1 otherwise.
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, 1
otherwise.
void pbc_param_out_str(FILE *stream, pbc_param_t p)
Write pairing parameters to ’stream’ in a text format.
void pbc_param_clear(pbc_param_t p)
Clear p. Call after p is no longer needed.
【译文】
第5章参数函数配对是从配对参数初始化的,配对参数是pbc_param_t类型的对象。某些应用程序可以忽略此数据类型,因为
pairing_init_set_str()
在后台处理该数据类型:它读取字符串作为pbc_param_t,然后使用这些参数初始化配对。
int pbc_param_init_set_str(pbc_param_t par,const char * s)
从字符串s初始化配对参数。如果成功,则返回0,否则返回1。
int pbc_param_init_set_buf(pbc_param_t par,const char * s,size_t len)
相同,但最多读取len个字节。如果len为0,则其行为与前一个函数相同。如果成功,则返回0,否则返回1。
void pbc_param_out_str(FILE * stream,pbc_param_t p)
将配对参数以文本格式写入“ stream”。
void pbc_param_clear(pbc_param_t p)
清除p。 p之后不再需要调用。
1.1. Param generation
These were used to prepare the sample parameters in the param subdirectory.
We label the pairing families with capital letters roughly in the order of discovery, so we can refer to them easily. Type A is fastest. Type D is a good choice when elements should be short but is slower. Type F has even shorter eleme