sum

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package sum is a VDAF for aggregating integers in a pre-determined range.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggShare

type AggShare = prio3.AggShare[Vec, Fp]

type Fp

type Fp = fp64.Fp

type InputShare

type InputShare = prio3.InputShare[Vec, Fp]

type Nonce

type Nonce = prio3.Nonce

type OutShare

type OutShare = prio3.OutShare[Vec, Fp]

type PrepMessage

type PrepMessage = prio3.PrepMessage

type PrepShare

type PrepShare = prio3.PrepShare[Vec, Fp]

type PrepState

type PrepState = prio3.PrepState[Vec, Fp]

type PublicShare

type PublicShare = prio3.PublicShare

type Sum

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

Sum is a verifiable distributed aggregation function in which each measurement is an integer in the range [0, maxMeasurement], where maxMeasurement defines the largest valid measurement, the aggregated result is the sum of all the measurements.

func New

func New(numShares uint8, maxMeasurement uint64, context []byte) (s *Sum, err error)

func (*Sum) AggregateInit

func (s *Sum) AggregateInit() AggShare

func (*Sum) AggregateUpdate

func (s *Sum) AggregateUpdate(aggShare *AggShare, outShare *OutShare)

func (*Sum) Params

func (s *Sum) Params() prio3.Params

func (*Sum) PrepInit

func (s *Sum) PrepInit(
	verifyKey *VerifyKey,
	nonce *Nonce,
	aggID uint8,
	publicShare PublicShare,
	inputShare InputShare,
) (*PrepState, *PrepShare, error)

func (*Sum) PrepNext

func (s *Sum) PrepNext(state *PrepState, msg *PrepMessage) (*OutShare, error)

func (*Sum) PrepSharesToPrep

func (s *Sum) PrepSharesToPrep(prepShares []PrepShare) (*PrepMessage, error)

func (*Sum) Shard

func (s *Sum) Shard(measurement uint64, nonce *Nonce, rand []byte,
) (PublicShare, []InputShare, error)

func (*Sum) Unshard

func (s *Sum) Unshard(aggShares []AggShare, numMeas uint) (aggregate *uint64, err error)

type Vec

type Vec = fp64.Vec

type VerifyKey

type VerifyKey = prio3.VerifyKey

Jump to

Keyboard shortcuts

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