]> Cypherpunks.ru repositories - gogost.git/commitdiff
PrivateKey % Q v5.5.0
authorSergey Matveev <stargrave@stargrave.org>
Mon, 25 Jan 2021 14:51:25 +0000 (17:51 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 25 Jan 2021 14:51:25 +0000 (17:51 +0300)
gogost.go
gost3410/private.go
news.texi

index e6ded96834f4b7489dae86b5b5e8582c79e31aa2..7b90a3bb7e343803d3269cd2010d638440f27a43 100644 (file)
--- 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"
index 4d73b07fc3f652c5c7018cea459503e47029f7f1..237a906cfacfbe3127cd21c79d14f37d0284f6fe 100644 (file)
@@ -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) {
index c825e47a3014e3ae172b5f43ea81c880e70cb067..919168c0335b3bdacbcf7c49e0302a1e7554d690 100644 (file)
--- 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.