decentralized-identity / did-jwt

Create and verify DID verifiable JWT's in Javascript
Apache License 2.0
331 stars 70 forks source link

[BUG] EdDSA signer accepts a 64 bytes `Uint8Array` while EdDSA private key is 32 Bytes #289

Closed coodos closed 11 months ago

coodos commented 1 year ago

Current Behavior

Currently if I go and try to create an EdDSA signer it expects a 64 Byte private key, while EdDSA private key is 32 bytes, I understand it wants to get a concatenated version of Private + Public, however in that case the variable naming seems misleading.

Expected Behavior

It asks for a 32 Byte key, or the name is more suggestive that you require a concatenated key with priv+public

Failure Information

Error: bad_key: Invalid private key format. Expecting 64 bytes, but got 32

Steps to Reproduce

  1. Use a private key seed which is 32 bytes
  2. try to create a EdDSA signer
  3. observe the signer fail

Environment Details

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Alternatives you considered

I would be more than happy to add a pull request which makes it so that we can accept both 32 byte and 64, this way the current functionality doesn't break.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mirceanis commented 11 months ago

Not stale, this is still a bug. @coodos we'd gladly accept a PR fixing this issue.

uport-automation-bot commented 11 months ago

:tada: This issue has been resolved in version 7.4.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: