Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Curve = tss.S256()
Curve is the curve implementation used across the tecdsa package.
IMPORTANT NOTE: The elliptic.UnmarshalCompressed function does not work as expected for this curve and always produces nil point coordinates. This is because the elliptic.UnmarshalCompressed always execute the y² = x³ - 3x + b equation to compute the y coordinate while the actual equation of the Curve (secp256k1) is y² = x³ + 7, i.e. the `a` parameter is 0 not -3.
var ErrIncompatiblePublicKey = fmt.Errorf(
"public key is not tECDSA compatible and will cause unmarshaling error",
)
ErrIncompatiblePublicKey indicates that the given public key is not compatible with the tECDSA, i.e. uses a different elliptic curve. Such a key cannot be marshalled and unmarshalled.
Functions ¶
This section is empty.
Types ¶
type PrivateKeyShare ¶
type PrivateKeyShare struct {
// contains filtered or unexported fields
}
PrivateKeyShare represents a private key share used to produce tECDSA signatures. Private key shares are generated as result of the tECDSA distributed key generation (DKG) process.
func NewPrivateKeyShare ¶
func NewPrivateKeyShare(data keygen.LocalPartySaveData) *PrivateKeyShare
NewPrivateKeyShare constructs a new instance of the tECDSA public key share based on the DKG result.
func (*PrivateKeyShare) Data ¶
func (pks *PrivateKeyShare) Data() keygen.LocalPartySaveData
Data returns the internal data of the private key share.
func (*PrivateKeyShare) Marshal ¶
func (pks *PrivateKeyShare) Marshal() ([]byte, error)
Marshal converts the PrivateKeyShare to a byte array.
func (*PrivateKeyShare) PublicKey ¶
func (pks *PrivateKeyShare) PublicKey() *ecdsa.PublicKey
PublicKey returns the ECDSA public key corresponding to the given tECDSA private key share.
func (*PrivateKeyShare) Unmarshal ¶
func (pks *PrivateKeyShare) Unmarshal(bytes []byte) error
Unmarshal converts a byte array back to the PrivateKeyShare.
type Signature ¶
Signature holds a signature in a form of two big.Int `r` and `s` values and a recovery ID value in {0, 1, 2, 3}.
The signature is chain-agnostic. Some chains (e.g. Ethereum and BTC) require `v` to start from 27. Please consult the documentation about what the particular chain expects.
func NewSignature ¶
func NewSignature(data *common.SignatureData) *Signature
NewSignature constructs a new instance of the tECDSA signature based on the signing result.