Skip to content

Commit

Permalink
fix: back out @noble/ed25519 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
alanshaw committed Jan 21, 2025
1 parent 1af6b4c commit 8b40b54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/principal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@ipld/dag-ucan": "^3.4.5",
"@noble/curves": "^1.2.0",
"@noble/ed25519": "^2.2.3",
"@noble/ed25519": "^1.7.3",
"@noble/hashes": "^1.3.2",
"@ucanto/interface": "workspace:^",
"multiformats": "^13.3.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/principal/src/ed25519/signer.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const derive = async secret => {
)
}

const publicKey = await ED25519.getPublicKeyAsync(secret)
const publicKey = await ED25519.getPublicKey(secret)
const signer = new Ed25519Signer(SIZE)

varint.encodeTo(code, signer, 0)
Expand Down Expand Up @@ -189,7 +189,7 @@ class Ed25519Signer extends Uint8Array {
* @returns {Promise<API.SignatureView<T, typeof Signature.EdDSA>>}
*/
async sign(payload) {
const raw = await ED25519.signAsync(payload, this.secret)
const raw = await ED25519.sign(payload, this.secret)

return Signature.create(this.signatureCode, raw)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/principal/src/ed25519/verifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Ed25519Verifier extends Uint8Array {
verify(payload, signature) {
return (
signature.code === signatureCode &&
ED25519.verifyAsync(signature.raw, payload, this.publicKey)
ED25519.verify(signature.raw, payload, this.publicKey)
)
}

Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8b40b54

Please sign in to comment.