new EC(modulus, a, b, n)
Raw container class for elliptic curves.
ASSUMES: 0 <= a, b, gx, gy < modulus, n > 0, and x^3 + b * x + a (mod modulus) is a non-singular curve of order n.
Parameters:
Name | Type | Description |
---|---|---|
modulus |
Modulus for underlying field. | |
a |
First coefficient for curve of Weierstrass normal form. | |
b |
Second coefficientfor curve of Weierstrass normal form. | |
n |
Order of elliptic curve. |
- Source:
Methods
affine(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 |
---|---|---|
A |
Point to affine. |
- Source:
equals(A, B)
Compares A and B.
Parameters:
Name | Type | Description |
---|---|---|
A |
Left point on curve. | |
B |
Right point on curve. |
- Source:
Returns:
true or false depending on if A and B represent the same
point on the curve or not.
jadd(A, B, C)
Sets A = B + C.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. | |
B |
Point on curve. | |
C |
Point on curve. |
- Source:
jdbl(A, B)
Sets A = 2 * B.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. | |
B |
Point on curve. |
- Source:
jmul(A, B, e)
Sets A = e * B.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. | |
B |
Point on curve. | |
e |
Scalar. |
- Source:
neg(A, B)
Sets A = -B.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. | |
B |
Point on curve. |
- Source:
set(A, B)
Sets A = B.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. | |
B |
Point on curve. |
- Source:
setzero(A)
Sets A = O, where O is the unit element of the
elliptic curve.
Parameters:
Name | Type | Description |
---|---|---|
A |
Holder of result. |
- Source: