AntonKueltz / fastecdsa

Python library for fast elliptic curve crypto
https://pypi.python.org/pypi/fastecdsa
The Unlicense
264 stars 77 forks source link

-Add "der_encode_signature" and "der_decode_signature" functions #24

Closed sirk390 closed 5 years ago

sirk390 commented 5 years ago

Hi Anton, what do you think about adding these functions? Do you have any comments?

AntonKueltz commented 5 years ago

Hi Christian,

Thanks for the pull request. I have no issue with adding DER encoding support. Is there a specific spec or RFC the current implementation is following? All I would ask is we add one or two test cases to ensure things are working as intended and also for regression test purposes.

Thanks, Anton

sirk390 commented 5 years ago

My code follows the details in BIP66, https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki without the "sighash: 1-byte" which is specific to bitcoin and without the max size, which I think is not applicable generally. It seems to come from https://tools.ietf.org/html/rfc2459 section 7.2.2 + ASN.1 Spec .

sirk390 commented 5 years ago

I'll fix python27 when I have some time and resubmit