Documentation ¶
Index ¶
- Constants
- 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 NewBLSKMAC(_ string) hash.Hasher
- 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) (valid bool, err error)
- func VerifySignatureFromRuntime(verifier SignatureVerifier, signature []byte, tag string, message []byte, ...) (bool, error)
- type DefaultSignatureVerifier
- type SignatureVerifier
Constants ¶
const RuntimeUserDomainTag = "user"
TODO: to delete and only rely on flow.UserDomainTag
Variables ¶
This section is empty.
Functions ¶
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 NewBLSKMAC ¶ 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) (valid bool, err error)
ValidatePublicKey returns true if public key is valid
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