FGasper / p5-Crypt-Perl

CPAN’s Crypt::Perl
Other
4 stars 4 forks source link

Deterministic signatures are dependant on message digest algorithm #17

Open bbrtj opened 11 months ago

bbrtj commented 11 months ago

Currently, there is no way to generate deterministic ECDSA signatures with sign method (taking digested message). Only way is to use for example sign_sha256, which digests the message.

This is a problem in some Bitcoin scenarios where the message must be signed with a fixed digested message of 0x0000000000000000000000000000000000000000000000000000000000000001. I'd still like to sign it deterministically, but currently can't without resorting to private methods.

FGasper commented 11 months ago

Hi. I'll consider merging a PR but am unlikely to add this myself.

bbrtj commented 11 months ago

@FGasper Do you think this should be added as a second argument to sign method, or a new method altogether?

FGasper commented 11 months ago

Separate method, I'd say.