diff options
author | tb <> | 2024-11-22 14:59:40 +0000 |
---|---|---|
committer | tb <> | 2024-11-22 14:59:40 +0000 |
commit | d25ca6829fcb33e9080bb5d7d5de5e01694d1cb7 (patch) | |
tree | 7790d27abad19186023db781852d4eb280ca3aa5 /src/regress | |
parent | aa15470973d1fcdb50d16c63b9cff3c9367ce30c (diff) | |
download | openbsd-d25ca6829fcb33e9080bb5d7d5de5e01694d1cb7.tar.gz openbsd-d25ca6829fcb33e9080bb5d7d5de5e01694d1cb7.tar.bz2 openbsd-d25ca6829fcb33e9080bb5d7d5de5e01694d1cb7.zip |
Split two helpers out of ec_wNAF_mul()
As its name indicates, the first, ec_compute_odd_multiples(), fills
point, 3 * point, 5 * point, ..., (2 * len - 1) * point into row[].
In fact, it first computes doubled = 2 * point and then goes on to
set row[i] = row[i - 1] + doubled. That's straightforward enough. One
change here is that this helper allocates row[i] on the fly rather
than preallocating the entire array of points up front.
The second piece is the actual precomputation, ec_wNAF_precompute().
It first computes the wNAF digits of the two scalars n and m (in this
order for now) with appropriate window size and length. Then the above
mentioned val[] array is allocated and populated with odd multiples
of point and generator. Finally, all points in val[] are made affine
in a single step, which means we only need one modular inversion, and
this then allows us to take fast paths in all the computations in the
one remaining loop in ec_wNAF_mul().
ok jsing
Diffstat (limited to 'src/regress')
0 files changed, 0 insertions, 0 deletions