crypto

package
v1.7.16 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: GPL-3.0 Imports: 39 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBitmapMismatch = errors.New("multi signer reported a mismatch in used bitmap")

ErrBitmapMismatch is raised when an invalid bitmap is passed to the multisigner

View Source
var ErrEmptyPubKeyString = errors.New("public key string is empty")

ErrEmptyPubKeyString is raised when an empty public key string is used

View Source
var ErrIndexOutOfBounds = errors.New("index is out of bounds")

ErrIndexOutOfBounds is raised when an out of bound index is used

View Source
var ErrInvalidSignature = errors.New("invalid signature was provided")

ErrInvalidSignature is raised for an invalid signature

View Source
var ErrNilBitmap = errors.New("bitmap is nil")

ErrNilBitmap is raised when a nil bitmap is used

View Source
var ErrNilElement = errors.New("element is nil")

ErrNilElement is raised when searching for a specific element but found nil

View Source
var ErrNilKeyGenerator = errors.New("key generator is nil")

ErrNilKeyGenerator is raised when a valid key generator is expected but nil used

View Source
var ErrNilKeysHandler = errors.New("nil keys handler")

ErrNilKeysHandler is raised when a nil keys handler was provided

View Source
var ErrNilMessage = errors.New("message to be signed or to be verified is nil")

ErrNilMessage is raised when trying to verify a nil signed message or trying to sign a nil message

View Source
var ErrNilMultiSignerContainer = errors.New("multi signer container is nil")

ErrNilMultiSignerContainer is raised when a nil multi signer container has been provided

View Source
var ErrNilPublicKeys = errors.New("public keys are nil")

ErrNilPublicKeys is raised when public keys are expected but received nil

View Source
var ErrNilSingleSigner = errors.New("nil single signer")

ErrNilSingleSigner signals that a nil single signer was provided

View Source
var ErrNoPublicKeySet = errors.New("no public key was set")

ErrNoPublicKeySet is raised when no public key was set for a multisignature

Functions

func CreateP2pKeyPair

func CreateP2pKeyPair(
	keyFileName string,
	keyGen crypto.KeyGenerator,
	log logger.Logger,
) (crypto.PrivateKey, crypto.PublicKey, error)

CreateP2pKeyPair will create a set of key pair for p2p based on provided pem file. If the provided key is empty it will generate a new one

func NewCryptoComponentsFactory

func NewCryptoComponentsFactory(args CryptoComponentsFactoryArgs) (*cryptoComponentsFactory, error)

NewCryptoComponentsFactory returns a new crypto components factory

func NewManagedCryptoComponents

func NewManagedCryptoComponents(ccf *cryptoComponentsFactory) (*managedCryptoComponents, error)

NewManagedCryptoComponents creates a new Crypto components handler

func NewMultiSignerContainer

func NewMultiSignerContainer(args MultiSigArgs, multiSignerConfig []config.MultiSignerConfig) (*container, error)

NewMultiSignerContainer creates the multiSignerContainer container

func NewSigningHandler added in v1.6.0

func NewSigningHandler(args ArgsSigningHandler) (*signingHandler, error)

NewSigningHandler will create a new signing handler component

Types

type ArgsSigningHandler added in v1.6.0

type ArgsSigningHandler struct {
	PubKeys              []string
	MultiSignerContainer cryptoCommon.MultiSignerContainer
	SingleSigner         crypto.SingleSigner
	KeyGenerator         crypto.KeyGenerator
	KeysHandler          consensus.KeysHandler
}

ArgsSigningHandler defines the arguments needed to create a new signing handler component

type CryptoComponentsFactoryArgs

type CryptoComponentsFactoryArgs struct {
	ValidatorKeyPemFileName              string
	AllValidatorKeysPemFileName          string
	SkIndex                              int
	Config                               config.Config
	EnableEpochs                         config.EnableEpochs
	PrefsConfig                          config.Preferences
	CoreComponentsHolder                 factory.CoreComponentsHolder
	KeyLoader                            factory.KeyLoaderHandler
	ActivateBLSPubKeyMessageVerification bool
	IsInImportMode                       bool
	ImportModeNoSigCheck                 bool
	P2pKeyPemFileName                    string
}

CryptoComponentsFactoryArgs holds the arguments needed for creating crypto components

type CryptoComponentsHandlerArgs

type CryptoComponentsHandlerArgs CryptoComponentsFactoryArgs

CryptoComponentsHandlerArgs holds the arguments required to create a crypto components handler

type MultiSigArgs

type MultiSigArgs struct {
	MultiSigHasherType   string
	BlSignKeyGen         crypto.KeyGenerator
	ConsensusType        string
	ImportModeNoSigCheck bool
}

MultiSigArgs holds the arguments for creating the multiSignerContainer container

Jump to

Keyboard shortcuts

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