Skip to content

Commit c1f84ce

Browse files
authored
sm2: naming convention
1 parent c6cc18e commit c1f84ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sm2/sm2.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ const (
4444
// It implemented both crypto.Decrypter and crypto.Signer interfaces.
4545
type PrivateKey struct {
4646
ecdsa.PrivateKey
47-
// inverseOfkeyPlus1 is set under inverseOfkeyPlus1Once
48-
inverseOfkeyPlus1 *bigmod.Nat
49-
inverseOfkeyPlus1Once sync.Once
47+
// inverseOfKeyPlus1 is set under inverseOfKeyPlus1Once
48+
inverseOfKeyPlus1 *bigmod.Nat
49+
inverseOfKeyPlus1Once sync.Once
5050
}
5151

5252
type pointMarshalMode byte
@@ -598,7 +598,7 @@ func (priv *PrivateKey) inverseOfPrivateKeyPlus1(c *sm2Curve) (*bigmod.Nat, erro
598598
dp1Inv, oneNat *bigmod.Nat
599599
dp1Bytes []byte
600600
)
601-
priv.inverseOfkeyPlus1Once.Do(func() {
601+
priv.inverseOfKeyPlus1Once.Do(func() {
602602
oneNat, _ = bigmod.NewNat().SetBytes(one.Bytes(), c.N)
603603
dp1Inv, err = bigmod.NewNat().SetBytes(priv.D.Bytes(), c.N)
604604
if err == nil {
@@ -608,15 +608,15 @@ func (priv *PrivateKey) inverseOfPrivateKeyPlus1(c *sm2Curve) (*bigmod.Nat, erro
608608
} else {
609609
dp1Bytes, err = _sm2ec.P256OrdInverse(dp1Inv.Bytes(c.N))
610610
if err == nil {
611-
priv.inverseOfkeyPlus1, err = bigmod.NewNat().SetBytes(dp1Bytes, c.N)
611+
priv.inverseOfKeyPlus1, err = bigmod.NewNat().SetBytes(dp1Bytes, c.N)
612612
}
613613
}
614614
}
615615
})
616616
if err != nil {
617617
return nil, errInvalidPrivateKey
618618
}
619-
return priv.inverseOfkeyPlus1, nil
619+
return priv.inverseOfKeyPlus1, nil
620620
}
621621

622622
func signSM2EC(c *sm2Curve, priv *PrivateKey, rand io.Reader, hash []byte) (sig []byte, err error) {

0 commit comments

Comments
 (0)