forked from TrueCloudLab/frostfs-api-go
6191903326
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
26 lines
487 B
Go
26 lines
487 B
Go
package signature
|
|
|
|
import (
|
|
"crypto/ecdsa"
|
|
|
|
crypto "github.com/nspcc-dev/neofs-crypto"
|
|
)
|
|
|
|
type cfg struct {
|
|
signFunc func(key *ecdsa.PrivateKey, msg []byte) ([]byte, error)
|
|
verifyFunc func(key *ecdsa.PublicKey, msg []byte, sig []byte) error
|
|
}
|
|
|
|
func defaultCfg() *cfg {
|
|
return &cfg{
|
|
signFunc: crypto.Sign,
|
|
verifyFunc: crypto.Verify,
|
|
}
|
|
}
|
|
|
|
func SignWithRFC6979() SignOption {
|
|
return func(c *cfg) {
|
|
c.signFunc = crypto.SignRFC6979
|
|
c.verifyFunc = crypto.VerifyRFC6979
|
|
}
|
|
}
|