(4)param functions

本文详细介绍了PBC库中配对参数的初始化和管理,包括不同类型的参数生成,如A型、D型、G型等,强调了在密码学应用中的安全性考虑,如元素长度和群阶的选择,以及CM参数的作用。文章还提到了参数文件的使用,为不同的应用场景提供了指导。
摘要由CSDN通过智能技术生成

以下内容源自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

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值