Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Signature ¶
Signature is a type representing either an ecdsa or schnorr signature.
func SignSchnorr ¶
func SignSchnorr(privateKey *bchec.PrivateKey, hash []byte) (*Signature, error)
signSchnorr signs the hash using the schnorr signature algorithm. The rfc6979 nonce derivation function accepts additional entropy. We are using the same entropy that is used by bitcoin-abc so our test vectors will be compatible. This byte string is chosen to avoid collisions with ECDSA which would render the signature insecure.
func (*Signature) Serialize ¶
Serialize returns the a serialized signature depending on the SignatureType. Note that the serialized bytes returned do not include the appended hash type used in Bitcoin signature scripts.
ECDSA signature in the more strict DER format.
encoding/asn1 is broken so we hand roll this output:
0x30 <length> 0x02 <length r> r 0x02 <length s> s