]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost3410/private.go
gost3410.PrivateKey satisfies crypto.Signer interface
[gogost.git] / src / cypherpunks.ru / gogost / gost3410 / private.go
index 03fd443335f1f4aa7885696cfccea78a31e2cc18..e445cfd22f0718e6995d63ddb1f9a8b3fef8a676 100644 (file)
@@ -17,6 +17,7 @@
 package gost3410
 
 import (
+       "crypto"
        "errors"
        "io"
        "math/big"
@@ -106,3 +107,15 @@ Retry:
                pad(r.Bytes(), int(prv.Mode))...,
        ), nil
 }
+
+func (prv *PrivateKey) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error) {
+       return prv.SignDigest(digest, rand)
+}
+
+func (prv *PrivateKey) Public() crypto.PublicKey {
+       pub, err := prv.PublicKey()
+       if err != nil {
+               panic(err)
+       }
+       return pub
+}