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

SharedXReceives the x coordinate of the shared point; zeroed on failure
DThe local private scalar
QX, QYThe peer public point
CurveCurve parameters from BPLoadCurve

Return values

TrueThe shared secret was computed
FalseQ 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

See also

BPPointOnCurve, BPLoadCurve, BPKeyGen