Add trivial ecmult_multi algorithm. It is selected when no scratch space is given and just multiplies and adds the points.

This commit is contained in:
Jonas Nick
2018-12-20 20:48:19 +00:00
parent 5545e13dea
commit bade617417
3 changed files with 33 additions and 1 deletions

View File

@@ -37,7 +37,8 @@ typedef int (secp256k1_ecmult_multi_callback)(secp256k1_scalar *sc, secp256k1_ge
* Chooses the right algorithm for a given number of points and scratch space
* size. Resets and overwrites the given scratch space. If the points do not
* fit in the scratch space the algorithm is repeatedly run with batches of
* points.
* points. If no scratch space is given then a simple algorithm is used that
* simply multiplies the points with the corresponding scalars and adds them up.
* Returns: 1 on success (including when inp_g_sc is NULL and n is 0)
* 0 if there is not enough scratch space for a single point or
* callback returns 0