Is there any implementation that computes div(x,y) mod l, where l is the order of the base point G and x,y are from that field (i.e. they are ge), or a function that calculates the inverse of a scalar in that field (inside the monero code base)?

(I saw that there might exist a function that computes it in the case thatx,y are fe- called fe_invert (or maybe fe_divpowm1?))


2 Answers 2


No. Bulletproofs currently use used to use openssl's BN API for this, and now use an optimized algorithm for computing the inverse of a set of scalars.

  • Very early Bulletproof code included BN (openssl), but current does not.
    – jtgrassie
    Sep 8, 2019 at 23:40
  • I updated the wording to reflect that change.
    – user36303
    Sep 9, 2019 at 15:19
  • Strictly speaking the Bulletproof function you reference does not perform div(x,y) mod l either, which is what the OP asked.
    – jtgrassie
    Sep 9, 2019 at 17:21

The division part no. The mod l part, yes, sc_reduce in src/crypto/crypto-ops.c.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.