]> git.codecow.com Git - Monocypher.git/commit
Define fe_invert() in terms of invsqrt()
authorLoup Vaillant <loup@loup-vaillant.fr>
Sat, 22 May 2021 13:30:02 +0000 (15:30 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Thu, 27 May 2021 18:15:05 +0000 (20:15 +0200)
commit61ecab579f9581b4b4c5d3791cb6a45e2698d155
tree970074175cbf2a1b805c8264c2002e17f6766bac
parent4340b98d82d3b941839d02869fd3327d17413a31
Define fe_invert() in terms of invsqrt()

Pros:
- The code is a couple lines shorter.
- Stack usage may be lowered a tiny little bit (we saved two temporary
  field elements).

Cons:
- Inversion is one field multiplication slower.

Note that fully optimised inversion can be 6 field multiplications
faster than the current version. It would cost quite a bit of code
though (we'd need a dedicated addition chain).
src/monocypher.c