Added Sign method to PrivateKey
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"filippo.io/edwards25519"
|
||||
@@ -46,6 +47,10 @@ func (priv *PrivateKey) Seed() []byte {
|
||||
return seed[:]
|
||||
}
|
||||
|
||||
func (priv *PrivateKey) Sign(_ io.Reader, digest []byte, _ crypto.SignerOpts) (signature []byte, err error) {
|
||||
return Sign(priv, digest), nil
|
||||
}
|
||||
|
||||
func (priv *PrivateKey) Public() crypto.PublicKey {
|
||||
p := &PublicKey{}
|
||||
newPublicKey(p, priv.pub[:])
|
||||
@@ -420,4 +425,7 @@ func verifyWithDom(pub *PublicKey, message, sig []byte, domPrefix, context strin
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ crypto.PrivateKey = (*PrivateKey)(nil)
|
||||
var (
|
||||
_ crypto.PrivateKey = (*PrivateKey)(nil)
|
||||
_ crypto.Signer = (*PrivateKey)(nil)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user