DCIT / perl-CryptX

https://metacpan.org/pod/CryptX
Other
35 stars 23 forks source link

add ethereum format signature #104

Closed shmakins closed 4 months ago

shmakins commented 5 months ago

This patch exposes functions Ethereum signature format. It's basically standard r,s values , plus recovery byte in the end. This format mainly used in Ethereum like cryptocurrencies for signing transaction. libtomcrypt has all required methods, just need to expose it the perl interface.

shmakins commented 4 months ago

I've also added recovery_pub method to make API complete. So library user can restore pub key, from signature and recovery bit. This is useful if you want to validate transaction in Ethereum family blockchain networks.

karel-m commented 4 months ago

could you please add documentation for:

shmakins commented 4 months ago

Sure, if it something that potentially could be merged. I'll cover new methods with documentation.

karel-m commented 4 months ago

Sorry, I should have mentioned that your PR looks good and I'am gonna merge it :)

karel-m commented 4 months ago

plus update t/pk_ecc.t:

- use Test::More tests => 124;
+ use Test::More tests => 127;
karel-m commented 4 months ago

And please rebase your branch on top of the current master. I have fixed some githibActions issue, it should now pass all checks.

shmakins commented 4 months ago

I've realised that there was a typo in method name , it should be recovery_pub_rfc7517 ( not ~recovery_pub_rfc8032~ ). Also added some test for all recovery* methods.