Home GnuPG

mpi/ec: add fast reduction for secp256k1

Description

mpi/ec: add fast reduction for secp256k1

* mpi/ec.c (ec_secp256k1_mod): New.
(field_table): Add 'secp256k1'.
* tests/t-mpi-point.c (check_ec_mul): Add secp256k1 test vectors.

Benchmark on Ryzen 7 5800X (x86_64):

Before:
secp256k1 | nanosecs/iter cycles/iter auto Mhz

mult |         482336       2340443      4852

After (~20% faster):
secp256k1 | nanosecs/iter cycles/iter auto Mhz

mult |         392941       1906540      4852
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Apr 24 2021, 7:47 PM
Parents
rC9d909cb67e70: mpi/ec: add fast reduction functions for NIST curves
Branches
Unknown
Tags
Unknown