pairinggroup¶
-
class
pairinggroup.
PairingGroup
(param_id, param_file=False, secparam=512, verbose=False)[source]¶ Bases:
object
-
GetBenchmark
(option)[source]¶ retrieves benchmark results for any of these options: RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Pair, Granular
-
StartBenchmark
(options)[source]¶ starts the benchmark with any of these options: RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Pair, Granular
-
deserialize
(obj, compression=True)[source]¶ Deserialize a bytes serialized element into a pairing object.
Parameters: compression – must be used for objects serialized with the compression parameter set to True. Default is True for compatibility with previous versions of charm.
-
serialize
(obj, compression=True)[source]¶ Serialize a pairing object into bytes.
Parameters: 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
-