sign

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package sign contains useful tools for the different signing algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletePolicy

type CompletePolicy struct {
}

CompletePolicy is the default policy requiring that all participants have cosigned to make a collective signature valid.

func (CompletePolicy) Check

Check verifies that all participants have contributed to a collective signature.

type Mask

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

Mask is a bitmask of the participation to a collective signature.

func NewMask

func NewMask(suite pairing.Suite, publics []kyber.Point, myKey kyber.Point) (*Mask, error)

NewMask creates a new mask from a list of public keys. If a key is provided, it will set the bit of the key to 1 or return an error if it is not found.

func (*Mask) CountEnabled

func (m *Mask) CountEnabled() int

CountEnabled returns the number of bit set to 1

func (*Mask) CountTotal

func (m *Mask) CountTotal() int

CountTotal returns the number of potential participants

func (*Mask) IndexOfNthEnabled

func (m *Mask) IndexOfNthEnabled(nth int) int

IndexOfNthEnabled returns the index of the nth enabled bit or -1 if out of bounds.

func (*Mask) Len

func (m *Mask) Len() int

Len returns the length of the byte array necessary to store the bitmask.

func (*Mask) Mask

func (m *Mask) Mask() []byte

Mask returns the bitmask as a byte array.

func (*Mask) Merge

func (m *Mask) Merge(mask []byte) error

Merge merges the given mask to the current one only if the length matches

func (*Mask) NthEnabledAtIndex

func (m *Mask) NthEnabledAtIndex(idx int) int

NthEnabledAtIndex returns the sum of bits set to 1 until the given index. In other words, it returns how many bits are enabled before the given index.

func (*Mask) Participants

func (m *Mask) Participants() []kyber.Point

Participants returns the list of public keys participating.

func (*Mask) Publics

func (m *Mask) Publics() []kyber.Point

Publics returns a copy of the list of public keys.

func (*Mask) SetBit

func (m *Mask) SetBit(i int, enable bool) error

SetBit turns on or off the bit at the given index.

func (*Mask) SetMask

func (m *Mask) SetMask(mask []byte) error

SetMask replaces the current mask by the new one if the length matches.

type ParticipationMask

type ParticipationMask interface {
	// CountEnabled returns the number of participants
	CountEnabled() int
	// CountTotal returns the number of candidates
	CountTotal() int
}

ParticipationMask is an interface to get the total number of candidates and the number of participants.

type Policy

type Policy interface {
	Check(m ParticipationMask) bool
}

Policy represents a fully customizable cosigning policy deciding what cosigner sets are and aren't sufficient for a collective signature to be considered acceptable to a verifier. The Check method may inspect the set of participants that cosigned by invoking cosi.Mask and/or cosi.MaskBit, and may use any other relevant contextual information (e.g., how security-critical the operation relying on the collective signature is) in determining whether the collective signature was produced by an acceptable set of cosigners.

type ThresholdPolicy

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

ThresholdPolicy allows to specify a simple t-of-n policy requring that at least the given threshold number of participants t have cosigned to make a collective signature valid.

func NewThresholdPolicy

func NewThresholdPolicy(thold int) *ThresholdPolicy

NewThresholdPolicy returns a new ThresholdPolicy with the given threshold.

func (ThresholdPolicy) Check

Check verifies that at least a threshold number of participants have contributed to a collective signature.

Directories

Path Synopsis
Package anon implements cryptographic primitives for anonymous communication.
Package anon implements cryptographic primitives for anonymous communication.
Package bdn implements the Boneh-Drijvers-Neven signature scheme which is an implementation of the bls package which is robust against rogue public-key attacks.
Package bdn implements the Boneh-Drijvers-Neven signature scheme which is an implementation of the bls package which is robust against rogue public-key attacks.
Package bls implements the Boneh-Lynn-Shacham (BLS) signature scheme which was introduced in the paper "Short Signatures from the Weil Pairing".
Package bls implements the Boneh-Lynn-Shacham (BLS) signature scheme which was introduced in the paper "Short Signatures from the Weil Pairing".
Package cosi implements the collective signing (CoSi) algorithm as presented in the paper "Keeping Authorities 'Honest or Bust' with Decentralized Witness Cosigning" by Ewa Syta et al.
Package cosi implements the collective signing (CoSi) algorithm as presented in the paper "Keeping Authorities 'Honest or Bust' with Decentralized Witness Cosigning" by Ewa Syta et al.
Package dss implements the Distributed Schnorr Signature protocol from the paper "Provably Secure Distributed Schnorr Signatures and a (t, n) Threshold Scheme for Implicit Certificates".
Package dss implements the Distributed Schnorr Signature protocol from the paper "Provably Secure Distributed Schnorr Signatures and a (t, n) Threshold Scheme for Implicit Certificates".
Package eddsa implements the EdDSA signature algorithm according to RFC8032.
Package eddsa implements the EdDSA signature algorithm according to RFC8032.
Package schnorr implements the vanilla Schnorr signature scheme.
Package schnorr implements the vanilla Schnorr signature scheme.
Package tbls implements the (t,n)-threshold Boneh-Lynn-Shacham signature scheme.
Package tbls implements the (t,n)-threshold Boneh-Lynn-Shacham signature scheme.

Jump to

Keyboard shortcuts

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