cryptimeleon / math

Library providing mathematical basics for (pairing-based) cryptography.
Apache License 2.0
10 stars 2 forks source link

Adding bucket support to debug group #124

Closed rheitjoh closed 3 years ago

rheitjoh commented 3 years ago

Done

How does it work?

DebugGroup and DebugBilinearGroup now support using named buckets to distinguish between different sets of counter data. The bucket can be switched via the setBucket method (for DebugBilinearGroup it will switch the buckets for G1, G2, GT, and the pairing counter all together). The system also distinguishes between the buckets sets for G1, G2, and GT, as well as the DebugGroup not belonging to a bilinear group (if you use the latter directly).

Initially, a default bucket is selected which is not named. You can go back to the default bucket via setDefaultBucket and it has separate getter methods and result formatting methods. Having it not be named increases the number of methods but ensures you do not need to remember a name such as "default".

There are also methods that sum up all the values from all the buckets. These have the suffix "allBuckets".

To format the results, there are still the formatCounterData() methods, albeit with some more options. These will currently print the results for all buckets plus the summed up results.