btccom/secp256k1-go

Why do all the test vector signatures have a trailing 0x01 byte?

Closed this issue · 1 comments

Is this like a null-terminator for DER encoding? I haven't seen it anywhere else.

afk11 commented

Hi - It's an artifact from where the signatures were copy/pasted from I think.. maybe the idea was to keep them the same in case more were to be added.. They were copied from a bitcoin library somewhere, and the extra byte is the 'hash type' for bitcoin transaction signatures.

https://github.com/btccom/secp256k1-go/blob/master/secp256k1/ecdsa_test.go#L40 the byte is stripped off during tests and has no real consequence for us.