TBPCurve

Data types, cryptography

Description

TBPCurve carries the complete domain parameters of one Brainpool curve. P is the prime field modulus, A and B are the coefficients of y^2 = x^3 + Ax + B mod P, Gx and Gy are the affine coordinates of the base point, and N is the order of that base point.

BPLoadCurve fills the record for brainpoolP256r1, brainpoolP384r1 or brainpoolP512r1 and sets Name to the RFC 5639 curve name. The arithmetic routines accept any record supplied by the caller, so custom parameters can be used, but they do not independently validate the curve.

Syntax

Delphi

TBPCurve = Record
  P, A, B, Gx, Gy, N: TBPValue;
  Name: AnsiString;
End;

Fields

PPrime modulus of the field
ACurve coefficient A
BCurve coefficient B
GxX coordinate of the base point G
GyY coordinate of the base point G
NOrder of the base point G
NameCurve name such as brainpoolP256r1; informational only

Remarks

BPLoadCurve starts from a default record and overwrites all six parameter values plus Name from the compiled RFC 5639 values.

BPKeyGen, BPSignFixedK, BPVerify, BPPointOnCurve and BPECDH take the record as a const parameter and never modify it.

BPPointOnCurve checks that both coordinates are below P and satisfy the curve equation; BPECDH and BPVerify call it before using a caller-supplied point, while BPKeyGen and BPSignFixedK only compare scalars against N.

See also

BPLoadCurve, BPKeyGen, BPSignFixedK, BPVerify, BPPointOnCurve, BPECDH