MCPcopy
hub / github.com/tjfoc/gmsm / Verify

Method Verify

sm2/sm2.go:77–84  ·  view source on GitHub ↗
(msg []byte, sign []byte)

Source from the content-addressed store, hash-verified

75}
76
77func (pub *PublicKey) Verify(msg []byte, sign []byte) bool {
78 var sm2Sign sm2Signature
79 _, err := asn1.Unmarshal(sign, &sm2Sign)
80 if err != nil {
81 return false
82 }
83 return Sm2Verify(pub, msg, default_uid, sm2Sign.R, sm2Sign.S)
84}
85
86func (pub *PublicKey) Sm3Digest(msg, uid []byte) ([]byte, error) {
87 if len(uid) == 0 {

Callers 4

verifyHandshakeSignatureFunction · 0.95
TestSm2Function · 0.45
BenchmarkSM2Function · 0.45

Calls 1

Sm2VerifyFunction · 0.85

Tested by 2

TestSm2Function · 0.36
BenchmarkSM2Function · 0.36