Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
coodos opened this issue Jul 14, 2023 · 3 comments · Fixed by #299
Closed

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

coodos opened this issue Jul 14, 2023 · 3 comments · Fixed by #299
Labels
bug Something isn't working released

Comments

@coodos
Copy link

coodos commented Jul 14, 2023

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.

  • node/browser version: v20.2.0
  • OS Version: MacOS 13.0.1
  • Device: MacBook Pro 2021 M1 Max

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.

@coodos coodos added the bug Something isn't working label Jul 14, 2023
@stale
Copy link

stale bot commented Sep 23, 2023

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.

@stale stale bot added the stale label Sep 23, 2023
@mirceanis mirceanis removed the stale label Sep 23, 2023
@mirceanis
Copy link
Member

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

mirceanis added a commit that referenced this issue Sep 27, 2023
Only the first 32 bytes are used as the actual key
fixes #289
mirceanis added a commit that referenced this issue Sep 27, 2023
Only the first 32 bytes are used as the actual key

fixes #289
uport-automation-bot pushed a commit that referenced this issue Sep 27, 2023
## [7.4.1](7.4.0...7.4.1) (2023-09-27)

### Bug Fixes

* accept 32 or 64 bytes as keys for EdDSASigner ([#299](#299)) ([546f31c](546f31c)), closes [#289](#289)
@uport-automation-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 7.4.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants