Documentation
¶
Index ¶
- func ComputeLayer(pp *PubVerPar, level uint64, prev_layer_nodes map[uint64]*TreeNode) map[uint64]*TreeNode
- func ComputeLeaves(pp *PubVerPar, es *EnumSet, level uint64) map[uint64]*TreeNode
- func ComputeNearestPowerof2(n uint64) uint64
- func Rep(pp *PubVerPar, es *EnumSet) (*Repr, Com)
- func VerifyOpen(pp *PubVerPar, com Com, x uint64, answer *Answer) bool
- func VerifyPath(pp *PubVerPar, com Com, x uint64, answer *Answer) bool
- func VerifyTease(com Com, x uint64, answer *Answer) bool
- func Vfy(pp *PubVerPar, com Com, x uint64, answer *Answer) bool
- type Answer
- type Com
- type EnumSet
- type Open
- type PubVerPar
- type Repr
- type Tease
- type Tree
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeLayer ¶
func ComputeLayer(pp *PubVerPar, level uint64, prev_layer_nodes map[uint64]*TreeNode) map[uint64]*TreeNode
Computes the non-leaf layers of the tree representation.
func ComputeLeaves ¶
Computes the leaves of the tree.
func ComputeNearestPowerof2 ¶
Computes the next highest power of 2 on input n.
func Rep ¶
Input: public parameters (h,ps) and an EnumSet. Return: ZKS representation and a commitment to it.
func VerifyOpen ¶
Verifies a hard commitment path.
func VerifyPath ¶
Verifies an authentication path for element x. Calls either VerifyOpen or VerifyTease.
func VerifyTease ¶
Verifies a soft commitment path.
Types ¶
type Answer ¶
type Answer struct {
// contains filtered or unexported fields
}
An answer contains the boolean set-membership reply and information used in the proof.
func MemberPath ¶
Computes an authentication path in the tree for an element in the set.
func NonMemberPath ¶
Computes an authentication path in the tree for an element not in the set.
type Com ¶
type Com struct {
// contains filtered or unexported fields
}
A commitment is two points on the EC.
type EnumSet ¶
type EnumSet struct {
// contains filtered or unexported fields
}
An enumerated set.
Values in the set are integers and the boolean value they map to indicates set membership. True indicates membership and false indicates non-membership. The max value is the maximum value of the set. Any value not explicitly in the set or greater than the maximum value will return false.
func NewEnumSet ¶
Takes in (a possibly empty) integer to bool map and a maximum value. Returns a new EnumSet structure.
type Open ¶
type Open struct {
// contains filtered or unexported fields
}
Information to open a commitment.
type PubVerPar ¶
type PubVerPar struct {
// contains filtered or unexported fields
}
h is the randomly selected point on the EC used for the commitment scheme ps is the randomly selected PRF
type Repr ¶
type Repr struct {
// contains filtered or unexported fields
}
A ZKS representation is the tree and the underlying EnumSet.
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is the internal ZKS representation. root is the commitment to the ZKS. tree is a nested map of nodes -- one map per level. levels is the depth of the tree.