# Fastest known Elliptic Curve Cryptography "solution" (coordinate systems (multiple?), algorithms, precomputed values etc)?

TL;DR: Does anyone have a reference to a study, implementation of different algorithms or otherwise "truth" about which solution - a set of coordinate systems and algorithms that enables the fastest known Point multiplication for e.g. X25519 (Curve25519) (Montgomery curve) and secp256k1 (Not Montgomery)?

I am writing an Elliptic Curve Cryptography SDK in pure Swift, and currently I am only using Affine Point and simple Double-and-add. I am soon about to work on a faster solution.

I am asking for help with the fastest known ECC arithmetic. Of course, we have different types of curves, so the answer is probably that some solutions only apply to certain curves (e.g. for Montgomery Curves we can use "Montgomery ladder" which seems fast).

(This question itself probably contains some errors, misunderstandings or inaccuracies, I apologize for that I am quite new to this. Give comments about my question I will correct it and type which corrections I did in an edit.)

Different curves/forms?:

1. Edwards
2. Montgomery
3. Weierstrass
4. Hessian

Point multiplication algorithms:

2. Windowed method
3. Sliding-window method
4. w-ary non-adjacent form (wNAF) method
5. Montgomery ladder (Only for Montgomery curves?)

Coordinate system:

I know that I can use a combination of different coordinate systems:

1. Affine
2. Projective
3. Jacobian (Weighted Projective)
4. Modified Jacobian
5. López–Dahab
6. Chudnovsky Jacobian

Promising papers:

The paper Complete addition formulas for prime order elliptic curves by Renes et al from 2015 (download from iacr.org) lists many different algorithms some of which mixes different coordinates systems looks promising.

The paper Fast elliptic curve point multiplication for WSNs by Ravi Kodali from 2013 (download from researchgate.net) proposes a mixture between Projective and Jacobian coordinates in combination with w-ary non-adjacent form (wNAF) method. It shows some promising results.

• Implementing a ECC library is certainly a learning experience... and on that basis alone it has value. Keep in mind that the fastest and most secure implementations generally implement the lower-level math in hand-written assembly language so that it can be optimized and also maintain consistent timings. If you want something fast, look at libsodium (there are Swift bindings somewhere). I've some experience here, so if you're looking for a less-optimized example, you might compare to github.com/jadeblaquiere/ecclib (Swift bindings would be very welcome, by the by).