diff --git a/README.md b/README.md index 5cf46ff..7c74f0f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Travis CI](https://app.travis-ci.com/emmansun/gmsm.svg?branch=main)](https://app.travis-ci.com/emmansun/gmsm) [![Github CI](https://github.com/emmansun/gmsm/actions/workflows/ci.yml/badge.svg)](https://github.com/emmansun/gmsm/actions/workflows/ci.yml) +[![Go Report Card]((https://goreportcard.com/report/github.com/emmansun/gmsm)](https://goreportcard.com/report/github.com/emmansun/gmsm) [![Documentation](https://godoc.org/github.com/emmansun/gmsm?status.svg)](https://godoc.org/github.com/emmansun/gmsm) [![Release](https://img.shields.io/github/release/emmansun/gmsm/all.svg)](https://github.com/emmansun/gmsm/releases) diff --git a/internal/sm2ec/sm2ec_test.go b/internal/sm2ec/sm2ec_test.go index 20b35f4..29f0ec3 100644 --- a/internal/sm2ec/sm2ec_test.go +++ b/internal/sm2ec/sm2ec_test.go @@ -149,7 +149,7 @@ func TestNISTP256MontgomeryDomain(t *testing.T) { func TestForSqrt(t *testing.T) { mod4 := new(big.Int).Mod(sm2Prime, big.NewInt(4)) if mod4.Cmp(big.NewInt(3)) != 0 { - t.Fatal("sm2 prime is not fufill 3 mod 4") + t.Fatal("sm2 prime is not fulfill 3 mod 4") } exp := new(big.Int).Add(sm2Prime, big.NewInt(1)) diff --git a/sm2/sm2_keyexchange.go b/sm2/sm2_keyexchange.go index f642049..791a3f0 100644 --- a/sm2/sm2_keyexchange.go +++ b/sm2/sm2_keyexchange.go @@ -171,7 +171,7 @@ func (ke *KeyExchange) ConfirmResponder(rB *ecdsa.PublicKey, sB []byte) ([]byte, return nil, errors.New("sm2: received invalid random from responder") } ke.peerSecret = rB - // Calcualte tA + // Calculate tA t := (&big.Int{}).And(ke.w2Minus1, ke.secret.X) t.Add(ke.w2, t) t.Mul(t, ke.r) diff --git a/sm2/sm2_test.go b/sm2/sm2_test.go index 873f0cb..6e38de0 100644 --- a/sm2/sm2_test.go +++ b/sm2/sm2_test.go @@ -269,7 +269,7 @@ func TestNonceSafety(t *testing.T) { } if r0.Cmp(r1) == 0 { - t.Error("SM2: the nonce used for two diferent messages was the same") + t.Error("SM2: the nonce used for two different messages was the same") } } diff --git a/sm9/sm9.go b/sm9/sm9.go index be257e1..3dde012 100644 --- a/sm9/sm9.go +++ b/sm9/sm9.go @@ -248,7 +248,7 @@ func (pub *EncryptMasterPublicKey) ScalarBaseMult(r *big.Int) *bn256.GT { return bn256.ScalarBaseMultGT(tables, r) } -// WrapKey generate and wrap key wtih reciever's uid and system hid +// WrapKey generate and wrap key with reciever's uid and system hid func WrapKey(rand io.Reader, pub *EncryptMasterPublicKey, uid []byte, hid byte, kLen int) (key []byte, cipher *bn256.G1, err error) { q := pub.GenerateUserPublicKey(uid, hid) var r *big.Int