ecgroup

class ecgroup.ECGroup(builtin_cv)[source]

Bases: object

EndBenchmark()[source]

ends an ongoing benchmark

GetBenchmark(option)[source]

retrieves benchmark results for any of these options: RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Granular

GetGeneralBenchmarks()[source]

retrieves benchmark count for all group operations

GetGranularBenchmarks()[source]

retrieves group operation count per type: ZR and G

InitBenchmark()[source]

initiates the benchmark state

StartBenchmark(options)[source]

starts the benchmark with any of these options: RealTime, CpuTime, Mul, Div, Add, Sub, Exp, Granular

bitsize()[source]

returns the bitsize for encoding messages in the group

coordinates(point)[source]

get the X and Y coordinates of an EC point

debug(data, prefix=None)[source]
decode(msg_bytes, include_ctr=False)[source]

decode a group element into a string

deserialize(bytes_object)[source]

deserializes into a pairing object

encode(message, include_ctr=False)[source]

encode arbitrary string as a group element. Max size is dependent on the EC group order

groupSetting()[source]
groupType()[source]
hash(args, target_type=0)[source]

hashes objects into ZR or G

init(_type=0)[source]

initializes an object with a specified type and value

order()[source]

returns the order of the group

paramgen(secparam)[source]
random(_type=0)[source]

selects a random element in ZR or G

serialize(object)[source]

serializes a pairing object into bytes

zr(point)[source]

get the X coordinate only