Documentation ¶
Index ¶
- Constants
- Variables
- func VerifySignature(sig *Signature, pk *PublicKey, msg []byte) (bool, error)
- func VerifySignatureBytes(msg [32]byte, sigBytes, pkBytes []byte) (ok bool, err error)
- type ProcessManagerMetrics
- type PublicKey
- type Request
- type Resp
- type SecretKey
- type Signature
- type StoreResp
- type VerificationManager
- func (rm *VerificationManager) AttachMetrics(m *metrics.Metrics)
- func (rm *VerificationManager) Enqueue(ctx context.Context, sig [96]byte, pubkey [48]byte, msg [32]byte) (err error)
- func (rm *VerificationManager) GetVerifyChan(stack uint) chan Request
- func (rm *VerificationManager) RunVerify(num uint)
- func (rm *VerificationManager) VerifyChan() chan Request
- func (rm *VerificationManager) VerifyParallel()
Constants ¶
View Source
const ( PublicKeyLength = bls12381.SizeOfG1AffineCompressed SecretKeyLength = fr.Bytes SignatureLength = bls12381.SizeOfG2AffineCompressed )
View Source
const ( ResponseQueueSubmit = iota ResponseQueueRegister ResponseQueueOther )
Variables ¶
View Source
var ( ErrInvalidPubkeyLength = errors.New("invalid public key length") ErrInvalidSecretKeyLength = errors.New("invalid secret key length") ErrInvalidSignatureLength = errors.New("invalid signature length") ErrSecretKeyIsZero = errors.New("invalid secret key is zero") )
View Source
var ErrInvalidSignature = errors.New("invalid signature")
Functions ¶
func VerifySignature ¶
Types ¶
type ProcessManagerMetrics ¶
type ProcessManagerMetrics struct { VerifyTiming *prometheus.HistogramVec RunningWorkers *prometheus.GaugeVec }
type PublicKey ¶ added in v0.6.0
func PublicKeyFromBytes ¶ added in v0.6.0
type Request ¶
type Request struct { Signature [96]byte Pubkey [48]byte Msg [32]byte // Unique identifier of payload // if needed to be passed back in response ID int Response *StoreResp }
VerifyReq is a request structure used in communication between api calls and fixed set of worker goroutines it's using return channel pattern, meaning that after sent the sender locks on that channel to get the response
type Resp ¶
Resp response structure - potential candidate for structure pool as it's almost constant size
type Signature ¶ added in v0.6.0
func SignatureFromBytes ¶ added in v0.6.0
type StoreResp ¶
type StoreResp struct {
// contains filtered or unexported fields
}
func (*StoreResp) SuccessfullIndexes ¶
type VerificationManager ¶
type VerificationManager struct { VerifySubmitBlockCh chan Request VerifyRegisterValidatorCh chan Request VerifyOtherCh chan Request // contains filtered or unexported fields }
func NewVerificationManager ¶
func NewVerificationManager(l log.Logger, verifySize uint) *VerificationManager
func (*VerificationManager) AttachMetrics ¶
func (rm *VerificationManager) AttachMetrics(m *metrics.Metrics)
func (*VerificationManager) GetVerifyChan ¶
func (rm *VerificationManager) GetVerifyChan(stack uint) chan Request
func (*VerificationManager) RunVerify ¶
func (rm *VerificationManager) RunVerify(num uint)
func (*VerificationManager) VerifyChan ¶
func (rm *VerificationManager) VerifyChan() chan Request
func (*VerificationManager) VerifyParallel ¶
func (rm *VerificationManager) VerifyParallel()
Click to show internal directories.
Click to hide internal directories.