refactor: switch to ed25519-keygen

This commit is contained in:
Derrick Hammer 2023-04-19 05:10:26 -04:00
parent 79f981d789
commit c25bf102fe
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 2 additions and 20 deletions

View File

@ -1,18 +0,0 @@
diff --git a/index.js b/index.js
index dc628dab1a201e6679a1716b3d51b56e4723b49d..9daeb44298586d51d7bb6e859a1dd696846e0078 100644
--- a/index.js
+++ b/index.js
@@ -115,11 +115,11 @@ class HDKey {
});
}
sign(message) {
- message = ensureBytes(message, 32);
+ message = ensureBytes(message);
return ed25519.sync.sign(message, this.privateKey);
}
verify(message, signature) {
- message = ensureBytes(message, 32);
+ message = ensureBytes(message);
signature = ensureBytes(signature, 64);
return ed25519.sync.verify(signature, message, this.publicKeyRaw);
}

View File

@ -25,6 +25,7 @@
"b4a": "^1.6.1", "b4a": "^1.6.1",
"compact-encoding": "^2.11.0", "compact-encoding": "^2.11.0",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"ed25519-keygen": "^0.4.1",
"ethers": "^5.6.9", "ethers": "^5.6.9",
"eventemitter2": "^6.4.9", "eventemitter2": "^6.4.9",
"fastify": "^4.10.2", "fastify": "^4.10.2",
@ -33,7 +34,6 @@
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"json-stringify-deterministic": "^1.0.7", "json-stringify-deterministic": "^1.0.7",
"loady": "git+https://github.com/LumeWeb/loady.git", "loady": "git+https://github.com/LumeWeb/loady.git",
"micro-ed25519-hdkey": "patch:micro-ed25519-hdkey@npm%3A0.1.2#~/.yarn/patches/micro-ed25519-hdkey-npm-0.1.2-5d1d767d1d.patch",
"msgpackr": "^1.6.1", "msgpackr": "^1.6.1",
"node-cache": "^5.1.2", "node-cache": "^5.1.2",
"node-cron": "^3.0.1", "node-cron": "^3.0.1",

View File

@ -1,4 +1,4 @@
import { HDKey } from "micro-ed25519-hdkey"; import { HDKey } from "ed25519-keygen/hdkey";
import config from "../config"; import config from "../config";
import * as bip39 from "@scure/bip39"; import * as bip39 from "@scure/bip39";
import { wordlist } from "@scure/bip39/wordlists/english"; import { wordlist } from "@scure/bip39/wordlists/english";