types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CastVoteRequest

type CastVoteRequest struct {
	UserID string
	// Marshalled representation of Ciphervote. It contains []{K:,C:}
	Ballot CiphervoteJSON
}

CastVoteRequest defines the HTTP request for casting a vote

type CiphervoteJSON

type CiphervoteJSON []EGPairJSON

CiphervoteJSON is the JSON representation of a ciphervote

type CreateFormRequest

type CreateFormRequest struct {
	AdminID       string
	Configuration etypes.Configuration
}

CreateFormRequest defines the HTTP request for creating a form

type CreateFormResponse

type CreateFormResponse struct {
	FormID string // hex-encoded
	Token  string
}

CreateFormResponse defines the HTTP response when creating a form

type EGPairJSON

type EGPairJSON struct {
	K []byte
	C []byte
}

EGPairJSON is the JSON representation of an ElGamal pair

type GetActorInfo

type GetActorInfo struct {
	Status int
	Error  HTTPError
}

GetActorInfo defines the result of a get actor info

type GetFormResponse

type GetFormResponse struct {
	// FormID is hex-encoded
	FormID          string
	Configuration   etypes.Configuration
	Status          uint16
	Pubkey          string
	Result          []etypes.Ballot
	Roster          []string
	ChunksPerBallot int
	BallotSize      int
	Voters          []string
}

GetFormResponse defines the HTTP response when getting the form info

type GetFormsResponse

type GetFormsResponse struct {
	Forms []LightForm
}

GetFormsResponse defines the HTTP response when getting all forms infos.

type HTTPError

type HTTPError struct {
	Title   string
	Code    uint
	Message string
	Args    map[string]interface{}
}

HTTPError defines the standard error format

type LightForm

type LightForm struct {
	FormID string
	Title  etypes.Title
	Status uint16
	Pubkey string
}

LightForm represents a light version of the form

type NewDKGRequest

type NewDKGRequest struct {
	FormID string // hex-encoded
}

NewDKGRequest defines the request to create a new DGK

type SignedRequest

type SignedRequest struct {
	Payload   string // url base64 encoded json message
	Signature string // hex encoded signature on sha256(Payload)
}

SignedRequest represents a frontend request signed by the web backend.

func NewSignedRequest

func NewSignedRequest(r io.Reader) (SignedRequest, error)

NewSignedRequest returns a new initialized signed request

func (SignedRequest) GetAndVerify

func (s SignedRequest) GetAndVerify(pk kyber.Point, el interface{}) error

GetAndVerify is a shorthand function to verify the signed request and extract the payload. el MUST be a pointer.

func (SignedRequest) GetMessage

func (s SignedRequest) GetMessage(el interface{}) error

GetMessage JSON unmarshals the payload to the given element. The given element MUST be a pointer.

func (SignedRequest) Verify

func (s SignedRequest) Verify(pk kyber.Point) error

Verify checks the signature. The signature should be on the sha256 of the payload.

type UpdateDKG

type UpdateDKG struct {
	Action string
}

UpdateDKG defines the input used to update dkg

type UpdateFormRequest

type UpdateFormRequest struct {
	Action string
}

UpdateFormRequest defines the HTTP request for updating a form

type UpdateShuffle

type UpdateShuffle struct {
	Action string
}

UpdateShuffle defines the input used to update the shuffle

Jump to

Keyboard shortcuts

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