session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package session implements helium sessions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenTestSecretKeys

func GenTestSecretKeys(sessParams Parameters) (secs map[helium.NodeID]*Secrets, err error)

Types

type Parameters

type Parameters struct {
	ID         helium.SessionID
	Nodes      []helium.NodeID
	RLWEParams bgv.ParametersLiteral
	Threshold  int
	ShamirPks  map[helium.NodeID]drlwe.ShamirPublicPoint
	PublicSeed []byte
	*Secrets
}

Parameters contains data used to initialize a Session.

type Secrets

type Secrets struct {
	PrivateSeed        []byte
	ThresholdSecretKey *drlwe.ShamirSecretShare
}

type Session

type Session struct {
	Parameters
	NodeID helium.NodeID
	Params bgv.Parameters
	// contains filtered or unexported fields
}

Session holds the session's critical state.

func NewSession

func NewSession(sessParams Parameters, nodeID helium.NodeID) (sess *Session, err error)

NewSession creates a new session.

func (*Session) Contains

func (sess *Session) Contains(nodeID helium.NodeID) bool

func (*Session) GetRLKEphemeralSecretKey

func (sess *Session) GetRLKEphemeralSecretKey() (*rlwe.SecretKey, error)

func (*Session) GetSecretKey

func (sess *Session) GetSecretKey() (*rlwe.SecretKey, error)

GetSecretKey loads the secret key from the ObjectStore.

func (*Session) GetSecretKeyForGroup

func (sess *Session) GetSecretKeyForGroup(parties []helium.NodeID) (sk *rlwe.SecretKey, err error)

func (*Session) GetSessionFromContext

func (sess *Session) GetSessionFromContext(ctx context.Context) (*Session, bool)

func (*Session) GetSessionFromID

func (sess *Session) GetSessionFromID(sessionID helium.SessionID) (*Session, bool)

func (*Session) GetShamirPublicPoints

func (sess *Session) GetShamirPublicPoints() map[helium.NodeID]drlwe.ShamirPublicPoint

func (*Session) GetShamirPublicPointsList

func (sess *Session) GetShamirPublicPointsList() []drlwe.ShamirPublicPoint

func (*Session) GetThresholdSecretKey

func (sess *Session) GetThresholdSecretKey() (*drlwe.ShamirSecretShare, error)

GetThresholdSecretKey loads the secret key from the ObjectStore.

func (*Session) String

func (sess *Session) String() string

type SessionProvider

type SessionProvider interface {
	GetSessionFromID(sessionID helium.SessionID) (*Session, bool)
	GetSessionFromContext(ctx context.Context) (*Session, bool)
}

type SessionStore

type SessionStore struct {
	// contains filtered or unexported fields
}

func NewSessionStore

func NewSessionStore() *SessionStore

func (*SessionStore) GetSessionFromID

func (s *SessionStore) GetSessionFromID(id helium.SessionID) (*Session, bool)

func (*SessionStore) NewRLWESession

func (s *SessionStore) NewRLWESession(sessParams Parameters, nodeID helium.NodeID) (sess *Session, err error)

type TestSession

type TestSession struct {
	SessParams    Parameters
	RlweParams    bgv.Parameters
	SkIdeal       *rlwe.SecretKey
	NodeSessions  map[helium.NodeID]*Session
	HelperSession *Session

	// key backend
	*helium.CachedKeyBackend

	// lattigo helpers
	Encoder   *bgv.Encoder
	Encryptor *rlwe.Encryptor
	Decrpytor *rlwe.Decryptor
}

func NewTestSession

func NewTestSession(N, T int, rlweparams bgv.ParametersLiteral, helperID helium.NodeID) (*TestSession, error)

func NewTestSessionFromParams

func NewTestSessionFromParams(sp Parameters, helperID helium.NodeID) (*TestSession, error)

Jump to

Keyboard shortcuts

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