signature

package
v4.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package signature provides an implementation of threshold signatures.

Threshold signatures use cryptography to allow a group of signers to collaboratively sign a message such that any subset of the signers can produce a valid signature, but no smaller group can.

This package defines functions and types for creating and verifying threshold signatures, including a struct for specifying and enforcing a minimum threshold signature requirement.

To prevent private key exposure or signature malleability, this package does not expose raw private keys or signatures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyShares

func NewKeyShares(total, threshold int,
	rsabits gcrypto.RSAPrikeyBits) (
	keyShares tcrsa.KeyShareList,
	keyMeta *tcrsa.KeyMeta,
	err error)

NewKeyShares generate total keyshares for threshold signature, any members exceed threshold can generate legal signature.

threshold must in [(total/2)+1, total]

func SignBySHA256

func SignBySHA256(content io.Reader,
	keyShares tcrsa.KeyShareList,
	keyMeta *tcrsa.KeyMeta) (signature []byte, err error)

SignBySHA256 generate signature by threshold members

func VerifyBySHA256

func VerifyBySHA256(content io.Reader, pubkey *rsa.PublicKey, signature []byte) error

VerifyBySHA256 verify signature by keyMeta.Pubkey

Types

This section is empty.

Jump to

Keyboard shortcuts

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