X-Git-Url: http://www.git.cypherpunks.ru/?p=gogost.git;a=blobdiff_plain;f=gost3410%2Fprivate.go;h=237a906cfacfbe3127cd21c79d14f37d0284f6fe;hp=4d73b07fc3f652c5c7018cea459503e47029f7f1;hb=72a7a96239127f18c7597c101a2091c87fc91c5a;hpb=874e14aa3ce292a3f5d0796f6ac9c4336911ca32 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) {