On an elliptic curve, the multiplication of a point P by a scalar k is defined by a series of operations over the
field of definition of the curve E, usually a finite field Fq. The computational cost of [k]P = P + P + ...+ P
(k times) is therefore expressed as the number of field operations (additions, multiplications, inversions). Scalar
multiplication is usually computed using variants of the binary algorithm (double-and-add, NAF, wNAF, etc).
If s is a small integer, optimized formula for [s]P can be used within a s-ary algorithm or with double-base
methods with bases 2 and s. Optimized formulas exists for very small scalars (s ≤ 5). However, the exponential
growth of the number of field operations makes it a very difficult task when s > 5. We present a generic method
to automate transformations of formulas for elliptic curves over prime fields in various systems of coordinates.
Our method uses a directed acyclic graph structure to find possible common subexpressions appearing in the
formula and several arithmetic transformations. It produces efficient formulas to compute [s]P for a large set
of small scalars s. In particular, we present a faster formula for P in Jacobian coordinates. Moreover, our
program can produce code for various mathematical software (Magma) and libraries (PACE).