herumi / mcl

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

Inquiry about Fr::mulSmall #205

Open quwenjie opened 1 month ago

quwenjie commented 1 month ago

https://github.com/herumi/mcl/blob/882951f21c80ea09dcdab9deb75b358fdc986f76/include/mcl/fp.hpp#L122 I am really interested in why this can perform the functionality of multiplying a field element with a small integer. I would be grateful if the author could offer some explanation on this topic. Are there any blogs/papers recommended on this topic? Thanks.

herumi commented 1 month ago

I did not refer to anything in particular. I'll write a brief explanation later. I'm sorry, but I'm busy right now, so please wait a little longer.

herumi commented 1 week ago

I write an algorithm of mulUnit and a Python script. https://github.com/herumi/mcl/blob/master/misc/mul-approx.py