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

Allow 32-byte secret keys (secret bytes only, no public bytes). #12

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @digitalbazaar/ed25519-multikey ChangeLog

## 1.2.0 - 2024-08-dd

### Added
- Allow 32-byte or 64-byte secret key values. The actual secret part of
the secret key is the first 32 bytes, but some implementations concatenate
the public key (an additional 32 bytes) onto the "secret key bytes"; this
feature allows either to be used.

## 1.1.0 - 2024-03-17

### Added
Expand Down
3 changes: 2 additions & 1 deletion lib/ed25519.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ function _secretKeyDerEncode({secretKeyBytes, seedBytes}) {
if(!seedBytes) {
assertKeyBytes({
bytes: secretKeyBytes,
expectedLength: 64
// allow 32 bytes or 64 bytes
expectedLength: secretKeyBytes.length === 32 ? 32 : 64
});
}
let p;
Expand Down
Loading