Libraries |
|
Elliptic | Source Code |
|
|
Types | ||||
| ||||
| ||||
| ||||
| ||||
|
ecPoint
const type: ecPoint
-
Type to describe a point at an elliptic curve. A point is either the neutral element or it is defined by x and y.
ellipticCurve
const type: ellipticCurve
-
Type to describe the elliptic curve y**2 = x**3 + a*x + b (mod p). The value p defines the finite field F. The values a and b specify the elliptic curve.
jacobianPoint
const type: jacobianPoint
-
Alternate type to describe a point at an elliptic curve. The curve points are on the elliptic curve y**2 = x**3 + a*x + b (mod p). This coordinates eliminate the need for expensive inversions mod p.
ecdsaSignatureType
const type: ecdsaSignatureType
-
Structure to hold an ECDSA signature. ECDSA is the Elliptic Curve Digital Signature Algorithm.
Constant Summary | |||||
ecPoint |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
| ||||
ellipticCurve |
|
Operator Summary | |||||
boolean |
| ||||
boolean |
|
Function Summary | |||||
ecPoint |
| ||||
ellipticCurve |
| ||||
integer |
| ||||
boolean |
| ||||
ecPoint |
| ||||
ecPoint |
| ||||
ecPoint |
| ||||
jacobianPoint |
| ||||
ecPoint |
| ||||
jacobianPoint |
| ||||
jacobianPoint |
| ||||
jacobianPoint |
| ||||
ecPoint |
| ||||
ecPoint |
| ||||
string |
| ||||
string |
| ||||
ecPoint |
| ||||
bigInteger |
| ||||
eccKeyPair |
| ||||
boolean |
| ||||
ecdsaSignatureType |
| ||||
boolean |
|
Constant Detail |
Operator Detail |
=
const func boolean: (in ecPoint: point1) = (in ecPoint: point2)
-
Check if two elliptic curve points are equal.
- Returns:
- TRUE if the two points are equal, FALSE otherwise.
<>
const func boolean: (in ecPoint: point1) <> (in ecPoint: point2)
-
Check if two elliptic curve points are not equal.
- Returns:
- FALSE if both numbers are equal, TRUE otherwise.
Function Detail |
ecPoint
const func ecPoint: ecPoint (in bigInteger: x, in bigInteger: y)
-
Create an elliptic curve point from the given coordinates x and y.
ellipticCurve
const func ellipticCurve: ellipticCurve (in integer: bits, in string: name, in bigInteger: p, in bigInteger: a, in bigInteger: b, in ecPoint: g, in bigInteger: n)
-
Create an elliptic curve from the given parameters. Creates the elliptic curve y**2 = x**3 + a*x + b (mod p).
- Parameters:
- bits - Number of bits in the elliptic curve.
- name - Name of the elliptic curve.
- p - In the finite field F all computations are (mod p).
- a - Possible negative factor from the curve formula.
- b - Possible negative constant from the curve formula.
- g - Base point of the elliptic curve.
- n - Order of g (mult(g, n) = neutralEcPoint).
getSizeInBytes
const func integer: getSizeInBytes (in ellipticCurve: curve)
-
Get the size of an elliptic curve in bytes. This is the number of bytes necessary to represent the x or y coordinate of an ecPoint.
element
const func boolean: element (in ecPoint: point, in ellipticCurve: curve)
-
Test, whether 'point' is on the given elliptic curve.
double
const func ecPoint: double (in ellipticCurve: curve, in ecPoint: p)
-
Double the point p over given curve. Double point in y**2 = x**3 + a*x + b (mod p).
add
const func ecPoint: add (in ellipticCurve: curve, in ecPoint: p1, in ecPoint: p2)
-
Add the points p1 and p2 over given curve. Addition of points in y**2 = x**3 + a*x + b (mod p).
mult
const func ecPoint: mult (in ellipticCurve: curve, in var ecPoint: p1, in var bigInteger: c)
-
Multiply point p1 by scalar c over given curve. Scalar multiplication p1 * c = p1 + p1 + ... + p1 (c times).
toJacobian
const func jacobianPoint: toJacobian (in ecPoint: p)
-
Transform point p given as (x, y) to jacobian coordinates.
fromJacobian
const func ecPoint: fromJacobian (in jacobianPoint: jp, in bigInteger: n)
-
Transform a point from jacobian coordinates to (x, y) mod n.
double
const func jacobianPoint: double (in ellipticCurve: curve, in jacobianPoint: jp)
-
Double the point jp in jacobian coordinates over given curve. Double point in y**2 = x**3 + a*x + b (mod p).
add
const func jacobianPoint: add (in ellipticCurve: curve, in jacobianPoint: jp1, in jacobianPoint: jp2)
-
Add the points jp1 and jp2 in jacobian coordinates over given curve. Addition of points in y**2 = x**3 + a*x + b (mod p).
mult
const func jacobianPoint: mult (in ellipticCurve: curve, in var jacobianPoint: jp1, in var bigInteger: c)
-
Multiply point jp1 by scalar c in jacobian coordinates over given curve. Scalar multiplication jp1 * c = jp1 + jp1 + ... + jp1 (c times).
multFast
const func ecPoint: multFast (in ellipticCurve: curve, in var ecPoint: p1, in var bigInteger: c)
-
Multiply point p1 by scalar c over given curve. Scalar multiplication p1 * c = p1 + p1 + ... + p1 (c times). Encapsulates the multiplication that is done with jacobian coordinates.
multAddFast
const func ecPoint: multAddFast (in ellipticCurve: curve, in var ecPoint: p1, in var bigInteger: c1, in var ecPoint: p2, in var bigInteger: c2)
-
Compute the sum of two products (ecPoint times scalar). Encapsulates the computation that is done with jacobian coordinates.
ecPointCompress
const func string: ecPointCompress (in ellipticCurve: curve, in ecPoint: point)
-
Encode an ecPoint in compressed form.
ecPointEncode
const func string: ecPointEncode (in ellipticCurve: curve, in ecPoint: point)
-
Encode an ecPoint in uncompressed form.
ecPointDecode
const func ecPoint: ecPointDecode (in ellipticCurve: curve, in string: encoded)
-
ecode an ecPoint, which can be compressed or uncompressed.
genPrivateKey
const func bigInteger: genPrivateKey (in ellipticCurve: curve)
-
Generate a private key for elliptic curve cryptography (ECC).
genEccKeyPair
const func eccKeyPair: genEccKeyPair (in ellipticCurve: curve)
-
Generate a new ECC keyPair (private key and public key).
verifyKeyPair
const func boolean: verifyKeyPair (in ellipticCurve: curve, in eccKeyPair: keyPair)
-
Verify that public and private key of an ECC keyPair fit together.
sign
const func ecdsaSignatureType: sign (in ellipticCurve: curve, in var bigInteger: message, in bigInteger: privateKey)
-
Compute the ECDSA signature of 'message'. ECDSA is the Elliptic Curve Digital Signature Algorithm.
verify
const func boolean: verify (in ellipticCurve: curve, in var bigInteger: message, in ecdsaSignatureType: signature, in ecPoint: publicKey)
-
Verify that 'signature' is a valid ECDSA signature of 'message'. ECDSA is the Elliptic Curve Digital Signature Algorithm.
|
|