PLSM2PublicKeyFromPrivate

Cryptography

Description

Derives the public key point P = [d]G from a private scalar

Syntax

Delphi

Function PLSM2PublicKeyFromPrivate(Const Curve: TPLSM2Curve;
  Const PrivateKey: TPLSM2Int; Out Px, Py: TPLSM2Int): Boolean;

Parameters

CurveCurve parameters, normally the SM2P256V1 constant
PrivateKeyPrivate scalar d
PxReceives the X coordinate of the public point
PyReceives the Y coordinate of the public point

Return values

FalseThe private key is out of range
TruePx and Py hold the public key point

Remarks

Part of the pure-Pascal SM2 suite (GB/T 32918) covering 256-bit prime-field arithmetic, Jacobian point operations and the SM3-based ZA derivation; the recommended sm2p256v1 curve ships as the SM2P256V1 constant and the specification appendix curve as SM2ExampleCurve

See also

PLSM2Sign, PLSM2Verify, PLValidateSM2Identity