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 ¶
- func NewKeyShares(total, threshold int, rsabits gcrypto.RSAPrikeyBits) (keyShares tcrsa.KeyShareList, keyMeta *tcrsa.KeyMeta, err error)
- func SignBySHA256(content io.Reader, keyShares tcrsa.KeyShareList, keyMeta *tcrsa.KeyMeta) (signature []byte, err error)
- func VerifyBySHA256(content io.Reader, pubkey *rsa.PublicKey, signature []byte) error
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
Types ¶
This section is empty.