Documentation
¶
Index ¶
- func SchnorrKeyPairFromBytes32(priv *PrivateKey, pub *PublicKey, data []byte) error
- type ECDSASignature
- func (s *ECDSASignature) FromBytes64(data []byte) error
- func (s *ECDSASignature) FromDER(data []byte, lax bool) error
- func (s *ECDSASignature) Sign(priv *PrivateKey, hash []byte) error
- func (s *ECDSASignature) ToBytes64(data []byte) []byte
- func (s *ECDSASignature) ToDER72(data []byte) []byte
- func (s *ECDSASignature) Verify(pub *PublicKey, hash []byte) bool
- type PrivateKey
- type PublicKey
- func (p *PublicKey) FromBytes32(data []byte) error
- func (p *PublicKey) FromBytes33(data []byte) error
- func (p *PublicKey) FromBytes64(data []byte) error
- func (p *PublicKey) FromPrivateKey(priv *PrivateKey) error
- func (p *PublicKey) ToBytes32(data []byte) []byte
- func (p *PublicKey) ToBytes33(data []byte) []byte
- func (p *PublicKey) ToBytes64(data []byte) []byte
- type SchnorrSignature
- func (s *SchnorrSignature) FromBytes64(data []byte) error
- func (s *SchnorrSignature) Sign(priv *PrivateKey, msg []byte) error
- func (s *SchnorrSignature) SignExt(priv *PrivateKey, msg []byte, auxRand *[32]byte, fastSign bool) error
- func (s *SchnorrSignature) ToBytes64(data []byte) []byte
- func (s *SchnorrSignature) Verify(pub *PublicKey, msg []byte) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchnorrKeyPairFromBytes32 ¶
func SchnorrKeyPairFromBytes32(priv *PrivateKey, pub *PublicKey, data []byte) error
SchnorrKeyPairFromBytes32 initializes priv and pub with a 32 byte private key.
The public key Y will always be even.
Types ¶
type ECDSASignature ¶
type ECDSASignature struct {
// contains filtered or unexported fields
}
func (*ECDSASignature) FromBytes64 ¶
func (s *ECDSASignature) FromBytes64(data []byte) error
FromBytes64 initializes from R and S, 32 bytes each.
func (*ECDSASignature) FromDER ¶
func (s *ECDSASignature) FromDER(data []byte, lax bool) error
FromBytes64 initializes from DER. If lax is false, strict canonical DER is enforced.
func (*ECDSASignature) Sign ¶
func (s *ECDSASignature) Sign(priv *PrivateKey, hash []byte) error
func (*ECDSASignature) ToBytes64 ¶
func (s *ECDSASignature) ToBytes64(data []byte) []byte
ToBytes64 writes R and S into the buffer and returns it.
func (*ECDSASignature) ToDER72 ¶
func (s *ECDSASignature) ToDER72(data []byte) []byte
ToBytes64 writes R and S into the buffer and returns it.
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func (*PrivateKey) FromBytes32 ¶
func (p *PrivateKey) FromBytes32(data []byte) error
func (*PrivateKey) ToBytes32 ¶
func (p *PrivateKey) ToBytes32(data []byte) []byte
ToBytes32 serializes the private key into the passed 32 byte buffer and returns it.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func (*PublicKey) FromBytes32 ¶
FromBytes32 initializes from even public key.
func (*PublicKey) FromBytes33 ¶
FromBytes33 initializes from compressed public key.
func (*PublicKey) FromBytes64 ¶
FromBytes64 initializes from a full public key, containing X and Y, 32 bytes each.
func (*PublicKey) FromPrivateKey ¶
func (p *PublicKey) FromPrivateKey(priv *PrivateKey) error
func (*PublicKey) ToBytes32 ¶
ToBytes32 writes the X coordinate into the passed buffer and returns it.
type SchnorrSignature ¶
type SchnorrSignature struct {
// contains filtered or unexported fields
}
func (*SchnorrSignature) FromBytes64 ¶
func (s *SchnorrSignature) FromBytes64(data []byte) error
FromBytes64 initializes s with R and S from the data buffer.
func (*SchnorrSignature) Sign ¶
func (s *SchnorrSignature) Sign(priv *PrivateKey, msg []byte) error
func (*SchnorrSignature) SignExt ¶
func (s *SchnorrSignature) SignExt(priv *PrivateKey, msg []byte, auxRand *[32]byte, fastSign bool) error
SignExt signs msg with priv, using auxRand as additional entropy to generate the nonce.
auxRand being nil is the same as passing a pointer to a zeroed 32 byte array.
fastSign tells the procedure to avoid some verifications, which may cause speed up depending of the underlying implementation.
func (*SchnorrSignature) ToBytes64 ¶
func (s *SchnorrSignature) ToBytes64(data []byte) []byte
ToBytes64 writes R and S into the data buffer, returning it.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
dcrsecp
Package secp256k1 implements optimized secp256k1 elliptic curve operations in pure Go.
|
Package secp256k1 implements optimized secp256k1 elliptic curve operations in pure Go. |
|
dcrsecp/ecdsa
Package ecdsa provides secp256k1-optimized ECDSA signing and verification.
|
Package ecdsa provides secp256k1-optimized ECDSA signing and verification. |