Documentation ¶
Index ¶
- func AggregatePublicKeys(keys []*runtime.PublicKey) (*runtime.PublicKey, error)
- func AggregateSignatures(sigs [][]byte) (crypto.Signature, error)
- func CryptoToRuntimeHashingAlgorithm(h hash.HashingAlgorithm) runtime.HashAlgorithm
- func CryptoToRuntimeSigningAlgorithm(s crypto.SigningAlgorithm) runtime.SignatureAlgorithm
- func HashWithTag(hashAlgo hash.HashingAlgorithm, tag string, data []byte) ([]byte, error)
- func NewPrefixedHashing(shaAlgo hash.HashingAlgorithm, tag string) (hash.Hasher, error)
- func RuntimeToCryptoHashingAlgorithm(s runtime.HashAlgorithm) hash.HashingAlgorithm
- func RuntimeToCryptoSigningAlgorithm(s runtime.SignatureAlgorithm) crypto.SigningAlgorithm
- func ValidatePublicKey(signAlgo runtime.SignatureAlgorithm, pk []byte) error
- func VerifyPOP(pk *runtime.PublicKey, s crypto.Signature) (bool, error)
- func VerifySignatureFromRuntime(verifier SignatureVerifier, signature []byte, tag string, message []byte, ...) (bool, error)
- type DefaultSignatureVerifier
- type SignatureVerifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregatePublicKeys ¶ added in v0.25.0
AggregatePublicKeys aggregate multiple public keys into one; currently only works for BLS
func AggregateSignatures ¶ added in v0.25.0
AggregateSignatures aggregate multiple signatures into one; currently only works for BLS
func CryptoToRuntimeHashingAlgorithm ¶
func CryptoToRuntimeHashingAlgorithm(h hash.HashingAlgorithm) runtime.HashAlgorithm
CryptoToRuntimeHashingAlgorithm converts a crypto hashing algorithm to a runtime hash algorithm.
func CryptoToRuntimeSigningAlgorithm ¶
func CryptoToRuntimeSigningAlgorithm(s crypto.SigningAlgorithm) runtime.SignatureAlgorithm
CryptoToRuntimeSigningAlgorithm converts a crypto signature algorithm to a runtime signature algorithm.
func HashWithTag ¶ added in v0.18.0
func NewPrefixedHashing ¶ added in v0.18.0
NewPrefixedHashing returns a new hasher that prefixes the tag for all hash computations (only when tag is not empty). Only SHA2 and SHA3 algorithms are supported.
func RuntimeToCryptoHashingAlgorithm ¶
func RuntimeToCryptoHashingAlgorithm(s runtime.HashAlgorithm) hash.HashingAlgorithm
RuntimeToCryptoHashingAlgorithm converts a runtime hash algorithm to a crypto hashing algorithm.
func RuntimeToCryptoSigningAlgorithm ¶
func RuntimeToCryptoSigningAlgorithm(s runtime.SignatureAlgorithm) crypto.SigningAlgorithm
RuntimeToCryptoSigningAlgorithm converts a runtime signature algorithm to a crypto signature algorithm.
func ValidatePublicKey ¶ added in v0.18.0
func ValidatePublicKey(signAlgo runtime.SignatureAlgorithm, pk []byte) error
ValidatePublicKey returns : - nil if key is valid and no exception occurred. - crypto.invalidInputsError if key is invalid and no exception occurred. - panics if an exception occurred.
func VerifyPOP ¶ added in v0.25.0
VerifyPOP verifies a proof of possession (PoP) for the receiver public key; currently only works for BLS
func VerifySignatureFromRuntime ¶
func VerifySignatureFromRuntime( verifier SignatureVerifier, signature []byte, tag string, message []byte, rawPublicKey []byte, signatureAlgorithm runtime.SignatureAlgorithm, hashAlgorithm runtime.HashAlgorithm, ) (bool, error)
VerifySignatureFromRuntime is an adapter that performs signature verification using raw values provided by the Cadence runtime.
Types ¶
type DefaultSignatureVerifier ¶
type DefaultSignatureVerifier struct{}
func NewDefaultSignatureVerifier ¶
func NewDefaultSignatureVerifier() DefaultSignatureVerifier