herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 152 forks source link

[cs] add missing functions, some arithmetic operator overloads #108

Closed UndeadRat22 closed 3 years ago

UndeadRat22 commented 3 years ago

Added some missing external functions, static factory for commonly used values, like Fr.One();. Also some overloads of arithmetic operators on G1.

herumi commented 3 years ago

Thank you for the patch. Do you need evaluatePolynomial and LagrangeInterpolation?

UndeadRat22 commented 3 years ago

Thank you for the patch. Do you need evaluatePolynomial and LagrangeInterpolation?

Yeah, I think I will need those later on. I will create more PRs once I get to that point :).

herumi commented 3 years ago

Okay, I'll append them later. By the way, could you tell me what do you use them if possible?

UndeadRat22 commented 3 years ago

I'm working on a KZG10 library in c#. After that's done I will move on to write an optimized version in rust. Will most likely use MCL there as well :).

herumi commented 3 years ago

I've added Fr/G1/G2 Share and Recover method. cf. https://github.com/herumi/mcl/blob/master/ffi/cs/test/test.cs#L289