models

package
v0.0.0-...-9b815d0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartAnalyst

func StartAnalyst(config *Config, userID, queryValue int64) (int64, []*big.Int)

StartAnalyst accept the configuration as in input and use SPADE to partially decrypt and get the results from a user's cipher

func StartServer

func StartServer(config *Config)

Types

type Analyst

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

func NewAnalyst

func NewAnalyst(q, g *big.Int, mpk []*big.Int) *Analyst

type Config

type Config struct {
	DbName      string
	TbName      string
	NumUsers    int
	MaxVecSize  int
	PaddingItem int
	TimeOut     time.Duration
	MaxMsgSize  int
}

func NewConfig

func NewConfig(dbName, tbName string, numUsers, maxVecSize, padItem int, tot time.Duration, mms int) *Config

type Curator

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

Curator we assume that it is trusted

func NewCurator

func NewCurator() *Curator

NewCurator creates a new instance of Curator

type DBHandler

type DBHandler interface {
	CreateUsersCipherTable() error
	InsertUsersCipher(data *pb.UserReq) error
	GetUserReqById(userId int64) (*pb.UserReq, error)
}

DBHandler is an interface to work with sqlite3 database API

func NewDBHandler

func NewDBHandler(database string, table string) DBHandler

type PBHandler

type PBHandler interface {
	ReadPublicParams(res *pb.PublicParamsResp, err error) (*big.Int, *big.Int, []*big.Int, error)
	ReadDecryptionKey(response *pb.AnalystResp, err error) ([]*big.Int, [][]*big.Int, error)
}

func NewPBHandler

func NewPBHandler() PBHandler

type User

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

func NewUser

func NewUser(uid int, q, g *big.Int, mpk []*big.Int) *User

func StartUser

func StartUser(config *Config, id int, data []int) (u *User)

StartUser accepts user id and user's data as inputs and uses SPADE scheme to encrypt user's data and send them to the server for storage

Jump to

Keyboard shortcuts

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