mpi/ec: small optimization for ec_mulm_448
* mpi/ec.c (ec_addm_448, ec_subm_448): Change order of sub_n and set_cond to remove need to clear 'n'. (ec_mulm_448): Use memcpy where possible; Use mpih_rshift where possible; Use mpih_lshift for doubling a3; Remove one addition at end.
Benchmarks on AMD Ryzen 7 5800X:
Before:
Ed448 | nanosecs/iter cycles/iter auto Mhz
keygen | 893096 4343326 4863 sign | 988422 4795694 4852 verify | 1899706 9215952 4851
After (~5% faster):
Ed448 | nanosecs/iter cycles/iter auto Mhz
keygen | 822078 3987952 4851 sign | 947327 4595433 4851 verify | 1776259 8616675 4851
- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>