Chia-Network / bls-signatures

BLS signatures in C++, using the blst library for BLS12-381
Apache License 2.0
292 stars 211 forks source link

Division operator for GTElement (e1/e2) #438

Open kofi-dalvik opened 9 months ago

kofi-dalvik commented 9 months ago

Currently creating a witness encryption scheme based on BLS signatures. I am using this library. However, I needed the GTElement class to support inversing through divisions. Instead of reimplementing element classes (since r is private in GT), this PR fixed the issue.

I know BLS signature implementation does not use division, but libraries that depend on this might need it. Moreover, my witness encryption library currently depends on my fork, and I want to use the main Chia-Network/bls-signatures instead.

coveralls-official[bot] commented 9 months ago

Pull Request Test Coverage Report for Build 6819261096

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report. To ensure accuracy in future PRs, please see these guidelines. A quick fix for this PR: rebase it; your next report should be accurate.


Totals Coverage Status
Change from base Build 6614779237: 0.03%
Covered Lines: 1654
Relevant Lines: 1747

💛 - Coveralls
hoffmang9 commented 8 months ago

Can you sign your commit?

hoffmang9 commented 8 months ago
image

Looks like something is still a bit off.

kofi-dalvik commented 8 months ago

image Looks like something is still a bit off.

Yeah i noticed and I'm resolving it. Used a different email for this repository

github-actions[bot] commented 6 months ago

'This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed.'

emlowe commented 2 months ago

Apologies for the long delay in looking at this. But I have a question. The included test is odd since division is not normally commutative - so one doesn't expect a test where a/b == b/a

I would expect something like (a*b)/b == a - does this version of division pass that test?

Reading a little more carefully, I see gt1 and gt2 are actually the same element - the test is then a/a == a/a which doesn't seem very useful?

kofi-dalvik commented 2 months ago

Hi @emlowe thanks for this message. In fact, I forgot about this PR.

Your observation is correct, which would be a more precise test. The current test works because gt1 and gt2 are both GT generators and are the same. It will make more sense that gt1 and gt2 are different elements. I'll update the test.

github-actions[bot] commented 1 week ago

'This PR has been flagged as stale due to no activity for over 60 days. It will not be automatically closed, but it has been given a stale-pr label and should be manually reviewed.'