castor

package
v0.0.0-...-ae8710e Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package castor implements a client to interact with _Carbyne Stack Castor_ services

Index

Constants

This section is empty.

Variables

View Source
var (
	// SPDZGfp provides the SPDZProtocol protocol definition following the Modulo a prime domain.
	SPDZGfp = SPDZProtocol{"SPDZ gfp", "p"}
	// SPDZGf2n provides the SPDZProtocol protocol definition following the GF(2^n) domain.
	SPDZGf2n = SPDZProtocol{"SPDZ gf2n_", "2"}
)
View Source
var (
	// BitGfp describes the Bits tuple type in the Mudulo a Prime domain.
	BitGfp = TupleType{"BIT_GFP", "Bits", SPDZGfp}
	// BitGf2n describes the Bits tuple type in the GF(2^n) domain.
	BitGf2n = TupleType{"BIT_GF2N", "Bits", SPDZGf2n}
	// InputMaskGfp describes the Inputs tuple type in the Mudulo a Prime domain.
	InputMaskGfp = TupleType{"INPUT_MASK_GFP", "Inputs", SPDZGfp}
	// InputMaskGf2n describes the Inputs tuple type in the GF(2^n) domain.
	InputMaskGf2n = TupleType{"INPUT_MASK_GF2N", "Inputs", SPDZGf2n}
	// InverseTupleGfp describes the Inverses tuple type in the Mudulo a Prime domain.
	InverseTupleGfp = TupleType{"INVERSE_TUPLE_GFP", "Inverses", SPDZGfp}
	// InverseTupleGf2n describes the Inverses tuple type in the GF(2^n) domain.
	InverseTupleGf2n = TupleType{"INVERSE_TUPLE_GF2N", "Inverses", SPDZGf2n}
	// SquareTupleGfp describes the Squares tuple type in the Mudulo a Prime domain.
	SquareTupleGfp = TupleType{"SQUARE_TUPLE_GFP", "Squares", SPDZGfp}
	// SquareTupleGf2n describes the Squares tuple type in the GF(2^n) domain.
	SquareTupleGf2n = TupleType{"SQUARE_TUPLE_GF2N", "Squares", SPDZGf2n}
	// MultiplicationTripleGfp describes the Triples tuple type in the Mudulo a Prime domain.
	MultiplicationTripleGfp = TupleType{"MULTIPLICATION_TRIPLE_GFP", "Triples", SPDZGfp}
	// MultiplicationTripleGf2n describes the Triples tuple type in the GF(2^n) domain.
	MultiplicationTripleGf2n = TupleType{"MULTIPLICATION_TRIPLE_GF2N", "Triples", SPDZGf2n}
)
View Source
var SupportedSPDZProtocols = []SPDZProtocol{
	SPDZGfp,
	SPDZGf2n,
}

SupportedSPDZProtocols is a list of all SPDZProtocol supported by castor and ephemeral.

SupportedTupleTypes is a list of all tuple types supported by the castor client.

Functions

This section is empty.

Types

type AbstractClient

type AbstractClient interface {
	GetTuples(tupleCount int32, tupleType TupleType, requestID uuid.UUID) (*TupleList, error)
}

AbstractClient is an interface for castor tuple client.

type Client

type Client struct {
	URL        url.URL
	HTTPClient *http.Client
}

Client is a client for the Castor tuple storage service

func NewClient

func NewClient(u url.URL) (*Client, error)

NewClient returns a new Castor client for the given endpoint

func (*Client) GetTuples

func (c *Client) GetTuples(count int32, tt TupleType, requestID uuid.UUID) (*TupleList, error)

GetTuples retrieves a list of tuples matching the given criteria from Castor

type SPDZProtocol

type SPDZProtocol struct {
	Descriptor string
	Shorthand  string
}

SPDZProtocol describes the protocol used for the MPC computation.

type Share

type Share struct {
	Value string `json:"value"`
	Mac   string `json:"mac"`
}

Share represents a single share of a tuple with its shared value and mac data.

type Tuple

type Tuple struct {
	Shares []Share `json:"shares"`
}

Tuple describes the actual tuple and its shares.

type TupleList

type TupleList struct {
	Tuples []Tuple `json:"tuples"`
}

TupleList is a collection of a specific type of tuples.

type TupleType

type TupleType struct {
	Name              string
	PreprocessingName string
	SpdzProtocol      SPDZProtocol
}

TupleType describes a type of Tuples provided by Castor.

Jump to

Keyboard shortcuts

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