crypto

package
v1.1.2-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECDSASignatureSize = 64
	ECDSAKeySize       = 65
)
View Source
const ErrorNamespaceCrypto = "crypto"

Variables

View Source
var (
	ErrInvalidKey        = sdkerrors.Register(ErrorNamespaceCrypto, 1200, "The public key is invalid in some way")
	ErrInvalidMerkleRoot = sdkerrors.Register(ErrorNamespaceCrypto, 1201, "The Merkle root hash is invalid in some way")
	ErrInvalidSignature  = sdkerrors.Register(ErrorNamespaceCrypto, 1202, "The signature is invalid in some way")
)

Functions

func GetPartiesHash

func GetPartiesHash(set []*types.Party) []byte

func GetPublicKeyHash

func GetPublicKeyHash(pk string) string

func GetThreshold

func GetThreshold(n int) int

func TryHexDecode

func TryHexDecode(hexStr string) []byte

func VerifyECDSA

func VerifyECDSA(hexSignature string, hexHash string, targetPublicKey string) error

VerifyECDSA accepts signature in [R||S] 64 gyte format and uncompressed public key in 64 bytes format (without leading 0x04).

func VerifyEdDSA

func VerifyEdDSA(hexSignature string, hexHash string, targetPublicKey string) error

func VerifyMerkleRoot

func VerifyMerkleRoot(hashes []merkle.Content, hexRoot string) error

Types

This section is empty.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL