From: Sergey Matveev Date: Mon, 25 Jan 2021 14:51:25 +0000 (+0300) Subject: PrivateKey % Q X-Git-Tag: v5.5.0^0 X-Git-Url: http://www.git.cypherpunks.ru/?p=gogost.git;a=commitdiff_plain;h=72a7a96239127f18c7597c101a2091c87fc91c5a PrivateKey % Q --- diff --git a/gogost.go b/gogost.go index e6ded96..7b90a3b 100644 --- a/gogost.go +++ b/gogost.go @@ -1,4 +1,4 @@ // Pure Go GOST cryptographic functions library. package gogost -const Version = "5.4.0" +const Version = "5.5.0" diff --git a/gost3410/private.go b/gost3410/private.go index 4d73b07..237a906 100644 --- a/gost3410/private.go +++ b/gost3410/private.go @@ -41,7 +41,7 @@ func NewPrivateKey(curve *Curve, raw []byte) (*PrivateKey, error) { if k.Cmp(zero) == 0 { return nil, errors.New("gogost/gost3410: zero private key") } - return &PrivateKey{curve, k}, nil + return &PrivateKey{curve, k.Mod(k, curve.Q)}, nil } func GenPrivateKey(curve *Curve, rand io.Reader) (*PrivateKey, error) { diff --git a/news.texi b/news.texi index c825e47..919168c 100644 --- a/news.texi +++ b/news.texi @@ -3,6 +3,11 @@ @table @strong +@anchor{Release 5.5.0} +@item 5.5.0 + @code{gost3410.PrivateKey} is in @code{gost3410.Curve.Q} now. That + makes them more friendly with some implementations. + @anchor{Release 5.4.0} @item 5.4.0 Even slightly less allocations in Streebog.