charm.toolbox.pairinggroup中PairingGroup类的使用说明

Help on class PairingGroup in module charm.toolbox.pairinggroup:

class PairingGroup(builtins.object)
 |  PairingGroup(param_id, param_file=False, secparam=512, verbose=False)
 |  
 |  Methods defined here:
 |  
 |  EndBenchmark(self)
 |      ends an ongoing benchmark
 |  
 |  GetBenchmark(self, option)
 |      retrieves benchmark results for any of these options: 
 |      RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Pair, Granular
 |  
 |  GetGeneralBenchmarks(self)
 |      retrieves benchmark count for all group operations
 |  
 |  GetGranularBenchmarks(self)
 |      retrieves group operation count per type: ZR, G1, G2, and GT
 |  
 |  InitBenchmark(self)
 |      initiates the benchmark state
 |  
 |  StartBenchmark(self, options)
 |      starts the benchmark with any of these options: 
 |      RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Pair, Granular
 |  
 |  __init__(self, param_id, param_file=False, secparam=512, verbose=False)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  
 |  __str__(self)
 |      Return str(self).
 |  
 |  debug(self, data, prefix=None)
 |  
 |  decode(self, element)
 |  
 |  deserialize(self, obj, compression=True)
 |      Deserialize a bytes serialized element into a pairing object. 
 |      
 |      :param compression: must be used for objects serialized with the
 |           compression parameter set to True. Default is True for
 |           compatibility with previous versions of charm.
 |  
 |  encode(self, message)
 |  
 |  groupSetting(self)
 |  
 |  groupType(self)
 |  
 |  hash(self, args, type=0)
 |      hashes objects into ZR, G1 or G2 depending on the pairing curve
 |  
 |  init(self, type, value=None)
 |      initializes an object with a specified type and value
 |  
 |  ismember(self, obj)
 |      membership test for a pairing object
 |  
 |  ismemberDict(self, obj)
 |      membership test for a dict of pairing objects
 |  
 |  ismemberList(self, obj)
 |      membership test for a list of pairing objects
 |  
 |  messageSize(self)
 |  
 |  order(self)
 |      returns the order of the group
 |  
 |  pair_prod(self, lhs, rhs)
 |      takes two lists of G1 & G2 and computes a pairing product
 |  
 |  paramgen(self, qbits, rbits)
 |  
 |  random(self, _type=0, count=1, seed=None)
 |      selects a random element in ZR, G1, G2 and GT
 |  
 |  serialize(self, obj, compression=True)
 |      Serialize a pairing object into bytes.
 |      
 |      :param compression: serialize the compressed representation of the
 |           curve element, taking about half the space but potentially
 |           incurring in non-negligible computation costs when
 |           deserializing. Default is True for compatibility with previous
 |           versions of charm.
 |       
 |       >>> p = PairingGroup('SS512')
 |       >>> v1 = p.random(G1)
 |       >>> b1 = p.serialize(v1)
 |       >>> b1 == p.serialize(v1, compression=True)
 |       True
 |       >>> v1 == p.deserialize(b1)
 |       True
 |       >>> b1 = p.serialize(v1, compression=False)
 |       >>> v1 == p.deserialize(b1, compression=False)
 |       True
 |  
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |  
 |  __dict__
 |      dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |      list of weak references to the object (if defined)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值