Skip to content

Commit

Permalink
Allow 32-byte secret keys (secret bytes only, no public bytes).
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Aug 20, 2024
1 parent 3f2cde6 commit 9d13d36
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit 9d13d36

Please sign in to comment.