This PR is the counterpart of #1861 for _ecmult_const: constant-time scalar multiplication with arbitrary points frequently involves a conversion to affine coordinates and clearing out the temporary Jacobian group element object after to avoid leaking secret key material, i.e. executing the following three functions:
secp256k1_ecmult_const(&rj, ...)secp256k1_ge_set_gej(&r, &rj)secp256k1_gej_clear(&rj)
A helper ecmult_const_ge is introduced to deduplicate code and mitigate the risk that the last step is forgotten (which can easily happen, as it would not be detected by tests). It is applied in the ECDH and silentpayments modules.
The idea came up in the course of reviewing the DLEQ module, where a gej clearing was missing, see #1802 (review).