Documentation ¶
Overview ¶
Package multi implements multisignatures on the bn256 curve.
The kind of signatures we implement here is, in general, known to be vulnerable to an attack. The attack, however, requires choosing ones public keys based on the public keys of other participants. Fortunately, in our situation, we can use a simple protection against it. Committee candidates should submit a hash of the public key they are going to use, and reveal the public key only as they are elected.
FOR SECURITY REASONS IT IS CRUCIAL THAT EITHER THE ABOVE OR SOME OTHER SOLUTION IS USED.
Index ¶
Constants ¶
const SignatureLength = bn256.SignatureLength
SignatureLength is the length of signatures created by this package.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keychain ¶
type Keychain struct {
// contains filtered or unexported fields
}
Keychain represents the set of keys used for the multisigning procedure.
func NewKeychain ¶
func NewKeychain(pubs []*bn256.VerificationKey, priv *bn256.SecretKey) *Keychain
NewKeychain creates a new keychain using the provided keys.
func (*Keychain) MultiVerify ¶
MultiVerify verifies whether the provided multisignature contains correctly signed data.
type Signature ¶
Signature represents a multisignature associated with a piece of data and keychain.
func NewSignature ¶
NewSignature creates a signature for the given data with the given threshold. At first it contains no partial signatures, they have to be aggregated.
func (*Signature) Aggregate ¶
Aggregate the given signature together with other signatures we received. Returns true if the multisignature is complete. The signature should be verified earlier.
func (*Signature) Marshal ¶
Marshal the multisignature to bytes. Only marshals the multisignature itself and the list of partial signatures included. Should only be called on complete proofs.
func (*Signature) MarshaledLength ¶
MarshaledLength returns how long would a marshaling of this proof be, in bytes.