-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy path@metamask-key-tree-npm-10.1.1-0bfab435ac.patch
More file actions
22 lines (22 loc) · 1.11 KB
/
@metamask-key-tree-npm-10.1.1-0bfab435ac.patch
File metadata and controls
22 lines (22 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/dist/curves/ed25519.cjs b/dist/curves/ed25519.cjs
index 3f6b0951c046dbda89f18edb7f17e6d23b839fc5..d2aee95598d942c0219128a77f6f83abdf206b80 100644
--- a/dist/curves/ed25519.cjs
+++ b/dist/curves/ed25519.cjs
@@ -14,6 +14,8 @@ const isValidPrivateKey = (_privateKey) => true;
exports.isValidPrivateKey = isValidPrivateKey;
exports.deriveUnhardenedKeys = false;
exports.publicKeyLength = 33;
+let _nativeUtils;
+try { _nativeUtils = require('@metamask/native-utils'); } catch (_) {}
const getGetPublicKey = () => {
let hasSetWindowSize = false;
const getPublicKey = (privateKey, _compressed) => {
@@ -21,7 +23,7 @@ const getGetPublicKey = () => {
ed25519_1.ed25519.ExtendedPoint.BASE._setWindowSize(4);
hasSetWindowSize = true;
}
- const publicKey = ed25519_1.ed25519.getPublicKey(privateKey);
+ const publicKey = (_nativeUtils && _nativeUtils.getPublicKeyEd25519) ? _nativeUtils.getPublicKeyEd25519(privateKey) : ed25519_1.ed25519.getPublicKey(privateKey);
return (0, utils_1.concatBytes)([new Uint8Array([0]), publicKey]);
};
return getPublicKey;