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
| Curve | Curve parameters, normally the SM2P256V1 constant |
|---|---|
| Px | X coordinate of the verifier public key point |
| Py | Y coordinate of the verifier public key point |
| Message | Raw message bytes; ZA must be prepended by the caller |
| ZA | User-ID digest from PLSM2ComputeZA |
| R | 32-byte big-endian signature part r |
| S | 32-byte big-endian signature part s |
Return values
| False | The signature does not verify, the values are out of range, or the encodings are malformed |
|---|---|
| True | The 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