neoneo-go/pkg/interop/crypto/crypto.go

22 lines
835 B
Go
Raw Normal View History

2020-05-18 07:58:27 +00:00
/*
Package crypto provides an interface to cryptographic syscalls.
*/
package crypto
import (
"github.com/nspcc-dev/neo-go/pkg/interop"
"github.com/nspcc-dev/neo-go/pkg/interop/neogointernal"
)
// ECDSASecp256r1CheckMultisig checks multiple ECDSA signatures at once. It uses
// `Neo.Crypto.CheckMultisigWithECDsaSecp256r1` syscall.
func ECDSASecp256r1CheckMultisig(msg []byte, pubs []interop.PublicKey, sigs []interop.Signature) bool {
return neogointernal.Syscall3("Neo.Crypto.CheckMultisigWithECDsaSecp256r1", msg, pubs, sigs).(bool)
}
2021-03-04 17:56:54 +00:00
// CheckSig checks that sig is correct script-container's signature for a given pub
// (serialized public key). It uses `Neo.Crypto.CheckSig` syscall.
func CheckSig(pub interop.PublicKey, sig interop.Signature) bool {
return neogointernal.Syscall2("Neo.Crypto.CheckSig", pub, sig).(bool)
}