Namespace: ec

verificatum.arithm.ec

Raw implementation of elliptic curves over prime order fields in Jacobi coordinates, i.e., the affine coordinates (x, y) corresponds to the projective coordinates (X * Z^2, Y * Z^3, Z).

Here elliptic curve points do not follow the object oriented pattern with methods for adding, doubling, and multiplying. Instead this is implemented in methods of the curve, or even plain functions. This avoids allocations. Thus, the API is half-way between different paradigms and the routines in this library are not meant to be used directly.

The implementation is close to a verbatim port of the corresponding code in the Verificatum Elliptic Curve library (VEC) written in C. In particular, the addition and doubling routines have been translated by search and replace.

All coordinates of elliptic curve points and temporary values are stored using L = 2 * L' + 4 limbs, where L' is equal to the minimal number of limbs needed to represent the order of the underlying field.

The addition and doubling routines have full-multiplication depth 1 before every modular reduction. There may also be a few additions or multiplication with integers bounded by 8. Such expressions fit nicely into L limbs. After modular reduction L' words remain and new expressions can be formed. This approach reduces the number of modular reductions.

Source:

Classes

EC
ECP

Methods

(static) affine(curve, A)

Changes the representation of the point to canonical coordinates, i.e. the unique representation where z is 1 and (x,y) is the corresponding affine point. The exception is the point at infinity which is left unchanged.
Parameters:
Name Type Description
curve Elliptic curve.
A Point to affine.
Source:

(static) jadd_generic(curve, A, B, C)

Sets A = B + C.
Parameters:
Name Type Description
curve Elliptic curve.
A Holder of result.
B Point on curve.
C Point on curve.
Source:

(static) jdbl_a_eq_neg3(curve, A, B)

Sets A = 2 * B.

ASSUMES: a = -3 for the curve.

References: Bernstein Jacobi coordinates (2001).

Parameters:
Name Type Description
curve Elliptic curve.
A Holder of result.
B Point on curve.
Source:

(static) jdbl_generic(curve, A, B)

Sets A = 2 * B.

References: Cohen/Miyaji/Ono Jacobi coordinates (1998).

Parameters:
Name Type Description
curve Elliptic curve.
A Holder of result.
B Point on curve.
Source:

(static) jmul_naive(curve, A, B, e)

Sets A = e * B.

Parameters:
Name Type Description
curve Elliptic curve.
A Holder of result.
B Point on curve.
e Scalar.
Source: