Skip to contentSkip to conversation

crypto: ecc - constant-time modular inversion?

DISCUSSION Ignat Korchagin 1 participant 1 message Sep 25 1 message not in the archive Crypto API

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CAH9NdkhqTDyNbK0uNyB9tnYwTbahMGVQgSXJ9PEnVQtDU14kXw@mail.gmail.com

#1 lore raw
Quoted 4 lines · Erwin Pawliczek

Hello,

vli_mod_inv() in crypto/ecc.c is currently responsible for modular inversion, it is currently a binary greatest common denominator loop where the iteration count depends on input. I'd like to replace it with a constant time algorithm, this one: https://eprint.iacr.org/2019/266

Is it used outside of ECDSA signature verification (with secret input)? If no, the replacement needs to be faster to justify the change

Quoted 7 lines

It runs a fixed number of divsteps for a given operand size, independent of input.

I already started working on a replacement, please let me know if this is something you'd be interested in.

Thanks,

Erwin

Ignat