Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
deatil committed May 10, 2024
1 parent 2e4252b commit 9e1b3d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gost/gost.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func newPrivateKey(curve *Curve, raw []byte) (*PrivateKey, error) {
return priv, nil
}

// GenerateKey generates a random GOST private key of the given bit size.
// GenerateKey generates a random GOST private key.
func GenerateKey(rand io.Reader, curve *Curve) (*PrivateKey, error) {
private := make([]byte, curve.PointSize())
if _, err := io.ReadFull(rand, private); err != nil {
Expand Down Expand Up @@ -271,7 +271,7 @@ Retry:

r, _, err = priv.Curve.Exp(k, priv.Curve.X, priv.Curve.Y)
if err != nil {
return nil, nil, fmt.Errorf("cryptobin/gost: %w", err)
return nil, nil, err
}

r.Mod(r, priv.Curve.Q)
Expand Down

0 comments on commit 9e1b3d2

Please sign in to comment.