BPECDH
Cryptography
Description
Computes the SEC 1 elliptic-curve Diffie-Hellman shared secret SharedX = x([D]Q) on a Brainpool curve
Syntax
Delphi
Function BPECDH(Out SharedX: TBPValue; Const D, QX, QY: TBPValue;
Const Curve: TBPCurve): Boolean;Parameters
| SharedX | Receives the x coordinate of the shared point; zeroed on failure |
|---|---|
| D | The local private scalar |
| QX, QY | The peer public point |
| Curve | Curve parameters from BPLoadCurve |
Return values
| True | The shared secret was computed |
|---|---|
| False | Q is not on the curve or the product is the point at infinity |
The secret is the bare x coordinate; run it through a KDF before use as a symmetric key (SEC 1 §3.3.1)
RFC 5639 Brainpool curves; validate the peer point or rely on the built-in on-curve check