decryptionplugin

package module
v0.0.0-...-e6634ab Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = fmt.Errorf("not found")
	ErrUnmarshalling = fmt.Errorf("cannot unmarshal the ciphertext in the query plugin function")
	ErrDecryption    = fmt.Errorf("cannot decrypt the ciphertext with the private key share in observation plugin function")
	ErrAggregation   = fmt.Errorf("cannot aggregate valid decryption shares in report plugn function")
)
View Source
var File_types_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CiphertextId

type CiphertextId []byte

func (CiphertextId) String

func (c CiphertextId) String() string

type CiphertextWithID

type CiphertextWithID struct {
	CiphertextId []byte `protobuf:"bytes,1,opt,name=ciphertext_id,json=ciphertextId,proto3" json:"ciphertext_id,omitempty"`
	Ciphertext   []byte `protobuf:"bytes,2,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
	// contains filtered or unexported fields
}

func (*CiphertextWithID) Descriptor deprecated

func (*CiphertextWithID) Descriptor() ([]byte, []int)

Deprecated: Use CiphertextWithID.ProtoReflect.Descriptor instead.

func (*CiphertextWithID) GetCiphertext

func (x *CiphertextWithID) GetCiphertext() []byte

func (*CiphertextWithID) GetCiphertextId

func (x *CiphertextWithID) GetCiphertextId() []byte

func (*CiphertextWithID) ProtoMessage

func (*CiphertextWithID) ProtoMessage()

func (*CiphertextWithID) ProtoReflect

func (x *CiphertextWithID) ProtoReflect() protoreflect.Message

func (*CiphertextWithID) Reset

func (x *CiphertextWithID) Reset()

func (*CiphertextWithID) String

func (x *CiphertextWithID) String() string

type DecryptionQueuingService

type DecryptionQueuingService interface {
	// GetRequests returns up to requestCountLimit oldest pending unique requests
	// with total size up to totalBytesLimit bytes size.
	GetRequests(requestCountLimit int, totalBytesLimit int) []DecryptionRequest

	// GetCiphertext returns the ciphertext matching ciphertextId
	// if it exists in the queue.
	// If the ciphertext does not exist it returns ErrNotFound.
	GetCiphertext(ciphertextId CiphertextId) ([]byte, error)

	// SetResult sets the plaintext (decrypted ciphertext) which corresponds to ciphertextId
	// or returns an error if the decrypted ciphertext is invalid.
	SetResult(ciphertextId CiphertextId, plaintext []byte, err error)
}

type DecryptionReportingPluginFactory

type DecryptionReportingPluginFactory struct {
	DecryptionQueue  DecryptionQueuingService
	ConfigParser     config.ConfigParser
	PublicKey        *tdh2easy.PublicKey
	PrivKeyShare     *tdh2easy.PrivateShare
	OracleToKeyShare map[commontypes.OracleID]int
	Logger           commontypes.Logger
}

func (DecryptionReportingPluginFactory) NewReportingPlugin

NewReportingPlugin complies with ReportingPluginFactory.

type DecryptionRequest

type DecryptionRequest struct {
	CiphertextId CiphertextId
	Ciphertext   []byte
}

type DecryptionShareWithID

type DecryptionShareWithID struct {
	CiphertextId    []byte `protobuf:"bytes,1,opt,name=ciphertext_id,json=ciphertextId,proto3" json:"ciphertext_id,omitempty"`
	DecryptionShare []byte `protobuf:"bytes,2,opt,name=decryption_share,json=decryptionShare,proto3" json:"decryption_share,omitempty"`
	// contains filtered or unexported fields
}

func (*DecryptionShareWithID) Descriptor deprecated

func (*DecryptionShareWithID) Descriptor() ([]byte, []int)

Deprecated: Use DecryptionShareWithID.ProtoReflect.Descriptor instead.

func (*DecryptionShareWithID) GetCiphertextId

func (x *DecryptionShareWithID) GetCiphertextId() []byte

func (*DecryptionShareWithID) GetDecryptionShare

func (x *DecryptionShareWithID) GetDecryptionShare() []byte

func (*DecryptionShareWithID) ProtoMessage

func (*DecryptionShareWithID) ProtoMessage()

func (*DecryptionShareWithID) ProtoReflect

func (x *DecryptionShareWithID) ProtoReflect() protoreflect.Message

func (*DecryptionShareWithID) Reset

func (x *DecryptionShareWithID) Reset()

func (*DecryptionShareWithID) String

func (x *DecryptionShareWithID) String() string

type Observation

type Observation struct {
	DecryptionShares []*DecryptionShareWithID `protobuf:"bytes,1,rep,name=decryption_shares,json=decryptionShares,proto3" json:"decryption_shares,omitempty"`
	// contains filtered or unexported fields
}

func (*Observation) Descriptor deprecated

func (*Observation) Descriptor() ([]byte, []int)

Deprecated: Use Observation.ProtoReflect.Descriptor instead.

func (*Observation) GetDecryptionShares

func (x *Observation) GetDecryptionShares() []*DecryptionShareWithID

func (*Observation) ProtoMessage

func (*Observation) ProtoMessage()

func (*Observation) ProtoReflect

func (x *Observation) ProtoReflect() protoreflect.Message

func (*Observation) Reset

func (x *Observation) Reset()

func (*Observation) String

func (x *Observation) String() string

type ProcessedDecryptionRequest

type ProcessedDecryptionRequest struct {
	CiphertextId []byte `protobuf:"bytes,1,opt,name=ciphertext_id,json=ciphertextId,proto3" json:"ciphertext_id,omitempty"`
	Plaintext    []byte `protobuf:"bytes,2,opt,name=plaintext,proto3" json:"plaintext,omitempty"`
	// contains filtered or unexported fields
}

func (*ProcessedDecryptionRequest) Descriptor deprecated

func (*ProcessedDecryptionRequest) Descriptor() ([]byte, []int)

Deprecated: Use ProcessedDecryptionRequest.ProtoReflect.Descriptor instead.

func (*ProcessedDecryptionRequest) GetCiphertextId

func (x *ProcessedDecryptionRequest) GetCiphertextId() []byte

func (*ProcessedDecryptionRequest) GetPlaintext

func (x *ProcessedDecryptionRequest) GetPlaintext() []byte

func (*ProcessedDecryptionRequest) ProtoMessage

func (*ProcessedDecryptionRequest) ProtoMessage()

func (*ProcessedDecryptionRequest) ProtoReflect

func (*ProcessedDecryptionRequest) Reset

func (x *ProcessedDecryptionRequest) Reset()

func (*ProcessedDecryptionRequest) String

func (x *ProcessedDecryptionRequest) String() string

type Query

type Query struct {
	DecryptionRequests []*CiphertextWithID `protobuf:"bytes,1,rep,name=decryption_requests,json=decryptionRequests,proto3" json:"decryption_requests,omitempty"`
	// contains filtered or unexported fields
}

func (*Query) Descriptor deprecated

func (*Query) Descriptor() ([]byte, []int)

Deprecated: Use Query.ProtoReflect.Descriptor instead.

func (*Query) GetDecryptionRequests

func (x *Query) GetDecryptionRequests() []*CiphertextWithID

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

func (x *Query) ProtoReflect() protoreflect.Message

func (*Query) Reset

func (x *Query) Reset()

func (*Query) String

func (x *Query) String() string

type Report

type Report struct {
	ProcessedDecryptedRequests []*ProcessedDecryptionRequest `protobuf:"bytes,1,rep,name=processedDecryptedRequests,proto3" json:"processedDecryptedRequests,omitempty"`
	// contains filtered or unexported fields
}

func (*Report) Descriptor deprecated

func (*Report) Descriptor() ([]byte, []int)

Deprecated: Use Report.ProtoReflect.Descriptor instead.

func (*Report) GetProcessedDecryptedRequests

func (x *Report) GetProcessedDecryptedRequests() []*ProcessedDecryptionRequest

func (*Report) ProtoMessage

func (*Report) ProtoMessage()

func (*Report) ProtoReflect

func (x *Report) ProtoReflect() protoreflect.Message

func (*Report) Reset

func (x *Report) Reset()

func (*Report) String

func (x *Report) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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