2020-05-18 07:58:27 +00:00
|
|
|
/*
|
|
|
|
Package crypto provides an interface to cryptographic syscalls.
|
|
|
|
*/
|
2018-08-22 08:12:57 +00:00
|
|
|
package crypto
|
|
|
|
|
2021-02-05 16:02:09 +00:00
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/interop"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/interop/neogointernal"
|
|
|
|
)
|
2020-08-28 07:47:15 +00:00
|
|
|
|
2021-03-09 15:11:21 +00:00
|
|
|
// CheckMultisig checks that script container (transaction) is signed by multiple
|
|
|
|
// ECDSA keys at once. It uses `Neo.Crypto.CheckMultisig` syscall.
|
|
|
|
func CheckMultisig(pubs []interop.PublicKey, sigs []interop.Signature) bool {
|
|
|
|
return neogointernal.Syscall2("Neo.Crypto.CheckMultisig", pubs, sigs).(bool)
|
2020-07-14 09:09:26 +00:00
|
|
|
}
|
|
|
|
|
2021-03-09 15:11:21 +00:00
|
|
|
// CheckSig checks that sig is correct signature of the script container
|
|
|
|
// (transaction) for a given pub (serialized public key). It uses
|
|
|
|
// `Neo.Crypto.CheckSig` syscall.
|
2021-03-04 17:56:54 +00:00
|
|
|
func CheckSig(pub interop.PublicKey, sig interop.Signature) bool {
|
|
|
|
return neogointernal.Syscall2("Neo.Crypto.CheckSig", pub, sig).(bool)
|
|
|
|
}
|