PLSM2Verify

Cryptography

Description

Verifies a GB/T 32918.2 signature over ZA || Message against a public key point

Syntax

Delphi

Function PLSM2Verify(Const Curve: TPLSM2Curve; Const Px, Py: TPLSM2Int;
  Const Message, ZA, R, S: AnsiString): Boolean;

Parameters

CurveCurve parameters, normally the SM2P256V1 constant
PxX coordinate of the verifier public key point
PyY coordinate of the verifier public key point
MessageRaw message bytes; ZA must be prepended by the caller
ZAUser-ID digest from PLSM2ComputeZA
R32-byte big-endian signature part r
S32-byte big-endian signature part s

Return values

FalseThe signature does not verify, the values are out of range, or the encodings are malformed
TrueThe signature verifies for the given point and ZA

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, PLSM2ComputeZA, PLSM2PublicKeyFromPrivate