Side-channel silent modular inverse

Torbjorn Granlund tg at
Fri Dec 27 20:15:01 UTC 2013

nisse at (Niels Möller) writes:

  > Create zero vector, invoke mpn_sub_n.
  That doesn't make it conditional. And I see no obvious way to do
  conditional negation on top of mpn_cnd_sub_n.

Compute T = 2 x A using mpn_add_n or mpn_lshift.
Use mpn_cnd_sub_n with A, T as arguments.


More information about the gmp-devel mailing list