herumi / mcl

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

How to find an inverse element for another element in Fr ? #114

Closed Henzi96 closed 3 years ago

Henzi96 commented 3 years ago

Hello. I would like to get an inverse element to another element in Java? Is this a correct procedure ? Thanks Fr element = new Fr(); element.setByCSPRNG(); Fr inverse_element = new Fr(); com.herumi.mcl.Mcl.neg(inverse_element, element);

herumi commented 3 years ago

I've added the method at https://github.com/herumi/mcl/commit/de148824a4fd7320e7cd42433a2b64ec6a991683 .