vanilla

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: CC0-1.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CROSSAllMethods

type CROSSAllMethods interface {
	GetProtocolData() common.ProtocolData
	GetTreeParams() common.TreeParams
	KeyGen() KeyPair
	DummyKeyGen(seed_sk []byte) KeyPair
	Sign(sk, msg []byte) (Signature, error)
	DummySign(salt, root_seed, sk, msg []byte) (Signature, error)
	Verify(pk Pk, m []byte, sig Signature) (bool, error)

	//arith
	Fz_dz_norm_n(v []byte) []byte
	Fz_inf_w_by_fz_matrix(fz_vec_e, W_mat []byte) []byte

	//seed
	SeedLeaves(seed, salt []byte) [][]byte
	RebuildLeaves(path [][]byte, salt []byte, chall_2 []bool) ([][]byte, bool)
	SeedPath(seed, salt []byte, chall_2 []bool) [][]byte

	//merkle
	TreeProof(commitments [][]byte, chall_2 []bool) [][]byte
	RecomputeRoot(cmt_0, proof [][]byte, chall_2 []bool) ([]byte, bool)
	TreeRoot(commitments [][]byte) []byte

	//Shake
	CSPRNG(seed []byte, output_len int, dsc uint16) []byte
	CSPRNG_fz_vec(seed []byte) []byte
	CSPRNG_fp_vec(seed []byte) []byte
	CSPRNG_fz_inf_w(seed []byte) []byte
	CSPRNG_fz_mat(seed []byte) ([]byte, sha3.ShakeHash)
	Expand_digest_to_fixed_weight(digest []byte) []bool
}

func NewCROSS

func NewCROSS(scheme_identifier common.CONFIG_IDENT) (CROSSAllMethods, error)

NewCROSS creates a new CROSS instance

type CROSSInstance

type CROSSInstance[T common.FP_ELEM, P common.FP_PREC] struct {
	*common.CROSS[T, P]
}

func (*CROSSInstance[T, P]) DummyKeyGen

func (c *CROSSInstance[T, P]) DummyKeyGen(seed_sk []byte) KeyPair

Dummy KeyGen function for testing purposes ONLY

func (*CROSSInstance[T, P]) DummySign

func (c *CROSSInstance[T, P]) DummySign(salt, root_seed, sk, msg []byte) (Signature, error)

func (*CROSSInstance[T, P]) Expand_pk

func (c *CROSSInstance[T, P]) Expand_pk(seed_pk []byte) ([]P, []byte)

func (*CROSSInstance[T, P]) Expand_sk

func (c *CROSSInstance[T, P]) Expand_sk(seed_sk []byte) ([]P, []byte, []byte, []byte)

func (*CROSSInstance[T, P]) GetProtocolData

func (c *CROSSInstance[T, P]) GetProtocolData() common.ProtocolData

func (*CROSSInstance[T, P]) GetTreeParams

func (c *CROSSInstance[T, P]) GetTreeParams() common.TreeParams

func (*CROSSInstance[T, P]) KeyGen

func (c *CROSSInstance[T, P]) KeyGen() KeyPair

func (*CROSSInstance[T, P]) Sign

func (c *CROSSInstance[T, P]) Sign(sk, msg []byte) (Signature, error)

func (*CROSSInstance[T, P]) ToSig

func (c *CROSSInstance[T, P]) ToSig(inp []byte) Signature

func (*CROSSInstance[T, P]) TtoByte

func (c *CROSSInstance[T, P]) TtoByte(arr []T) []byte

func (*CROSSInstance[T, P]) Verify

func (c *CROSSInstance[T, P]) Verify(pk Pk, m []byte, sig Signature) (bool, error)

type CROSSMethods

type CROSSMethods interface {
	KeyGen() (KeyPair, error)
}

type KeyPair

type KeyPair struct {
	Sk []byte
	Pk
}

type Pk

type Pk struct {
	SeedPK []byte
	S      []byte
}

type Resp_0_struct

type Resp_0_struct struct {
	Y       []byte
	V_bar   []byte
	V_G_bar []byte
}

type Signature

type Signature struct {
	Salt           []byte
	Digest_cmt     []byte
	Digest_chall_2 []byte
	Path           [][]byte
	Proof          [][]byte
	Resp_1         []byte
	Resp_0         []Resp_0_struct
}

func (*Signature) ToBytes

func (s *Signature) ToBytes() []byte

Jump to

Keyboard shortcuts

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