@unknownncat/curve25519-node 2.1.0 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/NOTICE.md +6 -6
- package/README.en.md +34 -391
- package/README.md +35 -392
- package/SECURITY.md +11 -0
- package/dist/axlsign.d.ts +1 -1
- package/dist/axlsign.d.ts.map +1 -1
- package/dist/axlsign.js +8 -29
- package/dist/axlsign.js.map +1 -1
- package/dist/cjs/axlsign.js +8 -29
- package/dist/cjs/axlsign.js.map +1 -1
- package/dist/cjs/index.js +2 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/assert.js +1 -1
- package/dist/cjs/internal/assert.js.map +1 -1
- package/dist/cjs/internal/axlsign-wasm/LICENSE +1 -1
- package/dist/cjs/internal/axlsign-wasm/axlsign_wasm.js +129 -65
- package/dist/cjs/internal/axlsign-wasm/axlsign_wasm_bg.wasm +0 -0
- package/dist/cjs/internal/axlsign-wasm/axlsign_wasm_bg.wasm.d.ts +8 -10
- package/dist/index.d.ts +1 -59
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/internal/assert.js +1 -1
- package/dist/internal/assert.js.map +1 -1
- package/dist/internal/axlsign-wasm/LICENSE +1 -1
- package/dist/internal/axlsign-wasm/axlsign_wasm.js +129 -65
- package/dist/internal/axlsign-wasm/axlsign_wasm_bg.wasm +0 -0
- package/dist/internal/axlsign-wasm/axlsign_wasm_bg.wasm.d.ts +8 -10
- package/package.json +12 -25
- package/dist/cjs/internal/curve25519-wasm/LICENSE +0 -21
- package/dist/cjs/internal/curve25519-wasm/curve25519_wasm.d.ts +0 -12
- package/dist/cjs/internal/curve25519-wasm/curve25519_wasm.js +0 -165
- package/dist/cjs/internal/curve25519-wasm/curve25519_wasm_bg.wasm +0 -0
- package/dist/cjs/internal/curve25519-wasm/curve25519_wasm_bg.wasm.d.ts +0 -13
- package/dist/cjs/internal/curve25519-wasm/package.json +0 -17
- package/dist/cjs/wasm.js +0 -228
- package/dist/cjs/wasm.js.map +0 -1
- package/dist/internal/curve25519-wasm/LICENSE +0 -21
- package/dist/internal/curve25519-wasm/curve25519_wasm.d.ts +0 -12
- package/dist/internal/curve25519-wasm/curve25519_wasm.js +0 -165
- package/dist/internal/curve25519-wasm/curve25519_wasm_bg.wasm +0 -0
- package/dist/internal/curve25519-wasm/curve25519_wasm_bg.wasm.d.ts +0 -13
- package/dist/internal/curve25519-wasm/package.json +0 -17
- package/dist/wasm.d.ts +0 -92
- package/dist/wasm.d.ts.map +0 -1
- package/dist/wasm.js +0 -204
- package/dist/wasm.js.map +0 -1
package/dist/cjs/axlsign.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axlsign.js","sourceRoot":"","sources":["../../src/axlsign.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"axlsign.js","sourceRoot":"","sources":["../../src/axlsign.ts"],"names":[],"mappings":";;AAoCA,8BAIC;AAKD,8BAKC;AAKD,0CAQC;AAMD,oBAUC;AAKD,wBAKC;AAKD,kCAcC;AAKD,kCAeC;AAhID,oDAM8B;AAC9B,uEAAuE;AAUvE,MAAM,YAAY,GAAG,WAA6C,CAAC;AAEnE,SAAS,WAAW,CAAC,MAAe;IAClC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IAC/B,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAChB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;IAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;IAC5B,OAAO,IAAA,qBAAS,EAAC,GAAG,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;GAEG;AACH,SAAgB,WAAW,CAAC,WAAoB,EAAE,SAAqB;IACrE,IAAA,yBAAa,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC1C,IAAA,4BAAgB,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEzC,IAAI,SAAS,CAAC,UAAU,GAAG,EAAE,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,qBAAqB,CAAC,CAAC;IAChF,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACnC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,WAAW,CAAC,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.verify = exports.openMessage = exports.generateKeyPairEd25519 = exports.generateKeyPairX25519 = exports.generateKeyPair = exports.sharedKeyStrict = exports.sharedKey = exports.
|
|
3
|
+
exports.verify = exports.openMessage = exports.generateKeyPairEd25519 = exports.generateKeyPairX25519 = exports.generateKeyPair = exports.sharedKeyStrict = exports.sharedKey = exports.axlsign = exports.ed25519 = exports.x25519 = exports.assertBytes64 = exports.assertBytes32 = exports.asBytes64 = exports.asBytes32 = void 0;
|
|
4
4
|
exports.sign = sign;
|
|
5
5
|
exports.signMessage = signMessage;
|
|
6
6
|
const assert_js_1 = require("./internal/assert.js");
|
|
7
7
|
const axlsignApi = require("./axlsign.js");
|
|
8
|
-
const wasmApi = require("./wasm.js");
|
|
9
8
|
const ed25519Api = require("./ed25519.js");
|
|
10
9
|
const x25519Api = require("./x25519.js");
|
|
11
10
|
var assert_js_2 = require("./internal/assert.js");
|
|
@@ -45,7 +44,7 @@ exports.ed25519 = {
|
|
|
45
44
|
openMessage: ed25519Api.openMessage,
|
|
46
45
|
};
|
|
47
46
|
/**
|
|
48
|
-
*
|
|
47
|
+
* Legacy-compatible axlsign namespace, accelerated by internal Rust/WASM bindings.
|
|
49
48
|
*/
|
|
50
49
|
exports.axlsign = {
|
|
51
50
|
publicKey: axlsignApi.publicKey,
|
|
@@ -56,13 +55,6 @@ exports.axlsign = {
|
|
|
56
55
|
signMessage: axlsignApi.signMessage,
|
|
57
56
|
openMessage: axlsignApi.openMessage,
|
|
58
57
|
};
|
|
59
|
-
/**
|
|
60
|
-
* Optional modern WASM namespace with X25519 + Ed25519 parity methods.
|
|
61
|
-
*/
|
|
62
|
-
exports.wasm = {
|
|
63
|
-
x25519: wasmApi.x25519,
|
|
64
|
-
ed25519: wasmApi.ed25519,
|
|
65
|
-
};
|
|
66
58
|
/**
|
|
67
59
|
* Top-level compatibility alias for X25519 shared secret.
|
|
68
60
|
*/
|
|
@@ -113,7 +105,6 @@ const api = {
|
|
|
113
105
|
x25519: exports.x25519,
|
|
114
106
|
ed25519: exports.ed25519,
|
|
115
107
|
axlsign: exports.axlsign,
|
|
116
|
-
wasm: exports.wasm,
|
|
117
108
|
sharedKey: exports.sharedKey,
|
|
118
109
|
sharedKeyStrict: exports.sharedKeyStrict,
|
|
119
110
|
generateKeyPair: exports.generateKeyPair,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAoFA,oBAIC;AAMD,kCAQC;AAtGD,oDAA2E;AAC3E,2CAA2C;AAC3C,2CAA2C;AAC3C,yCAAyC;AAGzC,kDAA0F;AAAj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B;IACrB,sBAAsB,EAAtB,8BAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW,EAAX,mBAAW;IACX,MAAM,EAAN,cAAM;CACE,CAAC;AAEX,kBAAe,GAAG,CAAC"}
|
|
@@ -36,7 +36,7 @@ function asBytes64(value, name = "value") {
|
|
|
36
36
|
}
|
|
37
37
|
function assertNoOptRandom(optRandom, fnName) {
|
|
38
38
|
if (optRandom !== undefined) {
|
|
39
|
-
throw new Error(`${fnName} does not support opt_random with
|
|
39
|
+
throw new Error(`${fnName} does not support opt_random with Ed25519. ` +
|
|
40
40
|
"Remove the third argument and use deterministic Ed25519 signing.");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assert.js","sourceRoot":"","sources":["../../../src/internal/assert.ts"],"names":[],"mappings":";;AAEA,4CAKC;AAQD,sCAGC;AAED,sCAGC;AAED,8BAGC;AAED,8BAGC;AAED,8CAOC;AAED,oCAEC;AA5CD,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAY;IAC3D,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;QACtD,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,mCAAmC,MAAM,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAiB,EAAE,QAAgB,EAAE,IAAY;IACrE,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,YAAY,QAAQ,oBAAoB,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1F,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,KAAiB,EAAE,IAAI,GAAG,OAAO;IAC7D,gBAAgB,CAAC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
|
7
7
|
function axlsignPublicKey(secret_key) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
try {
|
|
9
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
10
|
+
const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_export);
|
|
11
|
+
const len0 = WASM_VECTOR_LEN;
|
|
12
|
+
wasm.axlsignPublicKey(retptr, ptr0, len0);
|
|
13
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
14
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
15
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
16
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
17
|
+
if (r3) {
|
|
18
|
+
throw takeObject(r2);
|
|
19
|
+
}
|
|
20
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
21
|
+
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
22
|
+
return v2;
|
|
23
|
+
} finally {
|
|
24
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
13
25
|
}
|
|
14
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
15
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
16
|
-
return v2;
|
|
17
26
|
}
|
|
18
27
|
exports.axlsignPublicKey = axlsignPublicKey;
|
|
19
28
|
|
|
@@ -23,17 +32,26 @@ exports.axlsignPublicKey = axlsignPublicKey;
|
|
|
23
32
|
* @returns {Uint8Array}
|
|
24
33
|
*/
|
|
25
34
|
function axlsignSharedKey(secret_key, public_key) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
35
|
+
try {
|
|
36
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
37
|
+
const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_export);
|
|
38
|
+
const len0 = WASM_VECTOR_LEN;
|
|
39
|
+
const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_export);
|
|
40
|
+
const len1 = WASM_VECTOR_LEN;
|
|
41
|
+
wasm.axlsignSharedKey(retptr, ptr0, len0, ptr1, len1);
|
|
42
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
43
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
44
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
45
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
46
|
+
if (r3) {
|
|
47
|
+
throw takeObject(r2);
|
|
48
|
+
}
|
|
49
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
50
|
+
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
51
|
+
return v3;
|
|
52
|
+
} finally {
|
|
53
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
33
54
|
}
|
|
34
|
-
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
35
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
36
|
-
return v3;
|
|
37
55
|
}
|
|
38
56
|
exports.axlsignSharedKey = axlsignSharedKey;
|
|
39
57
|
|
|
@@ -43,17 +61,26 @@ exports.axlsignSharedKey = axlsignSharedKey;
|
|
|
43
61
|
* @returns {Uint8Array}
|
|
44
62
|
*/
|
|
45
63
|
function axlsignSign(secret_key, msg) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
try {
|
|
65
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
66
|
+
const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_export);
|
|
67
|
+
const len0 = WASM_VECTOR_LEN;
|
|
68
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_export);
|
|
69
|
+
const len1 = WASM_VECTOR_LEN;
|
|
70
|
+
wasm.axlsignSign(retptr, ptr0, len0, ptr1, len1);
|
|
71
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
72
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
73
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
74
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
75
|
+
if (r3) {
|
|
76
|
+
throw takeObject(r2);
|
|
77
|
+
}
|
|
78
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
79
|
+
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
80
|
+
return v3;
|
|
81
|
+
} finally {
|
|
82
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
53
83
|
}
|
|
54
|
-
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
55
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
56
|
-
return v3;
|
|
57
84
|
}
|
|
58
85
|
exports.axlsignSign = axlsignSign;
|
|
59
86
|
|
|
@@ -64,19 +91,28 @@ exports.axlsignSign = axlsignSign;
|
|
|
64
91
|
* @returns {Uint8Array}
|
|
65
92
|
*/
|
|
66
93
|
function axlsignSignRnd(secret_key, msg, rnd) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
94
|
+
try {
|
|
95
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
96
|
+
const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_export);
|
|
97
|
+
const len0 = WASM_VECTOR_LEN;
|
|
98
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_export);
|
|
99
|
+
const len1 = WASM_VECTOR_LEN;
|
|
100
|
+
const ptr2 = passArray8ToWasm0(rnd, wasm.__wbindgen_export);
|
|
101
|
+
const len2 = WASM_VECTOR_LEN;
|
|
102
|
+
wasm.axlsignSignRnd(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
103
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
104
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
105
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
106
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
107
|
+
if (r3) {
|
|
108
|
+
throw takeObject(r2);
|
|
109
|
+
}
|
|
110
|
+
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
111
|
+
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
112
|
+
return v4;
|
|
113
|
+
} finally {
|
|
114
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
76
115
|
}
|
|
77
|
-
var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
78
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
79
|
-
return v4;
|
|
80
116
|
}
|
|
81
117
|
exports.axlsignSignRnd = axlsignSignRnd;
|
|
82
118
|
|
|
@@ -87,17 +123,25 @@ exports.axlsignSignRnd = axlsignSignRnd;
|
|
|
87
123
|
* @returns {boolean}
|
|
88
124
|
*/
|
|
89
125
|
function axlsignVerify(public_key, msg, signature) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
try {
|
|
127
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
+
const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_export);
|
|
129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
130
|
+
const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_export);
|
|
131
|
+
const len1 = WASM_VECTOR_LEN;
|
|
132
|
+
const ptr2 = passArray8ToWasm0(signature, wasm.__wbindgen_export);
|
|
133
|
+
const len2 = WASM_VECTOR_LEN;
|
|
134
|
+
wasm.axlsignVerify(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
135
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
136
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
137
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
138
|
+
if (r2) {
|
|
139
|
+
throw takeObject(r1);
|
|
140
|
+
}
|
|
141
|
+
return r0 !== 0;
|
|
142
|
+
} finally {
|
|
143
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
99
144
|
}
|
|
100
|
-
return ret[0] !== 0;
|
|
101
145
|
}
|
|
102
146
|
exports.axlsignVerify = axlsignVerify;
|
|
103
147
|
|
|
@@ -107,16 +151,7 @@ function __wbg_get_imports() {
|
|
|
107
151
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
108
152
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
109
153
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
110
|
-
return ret;
|
|
111
|
-
},
|
|
112
|
-
__wbindgen_init_externref_table: function() {
|
|
113
|
-
const table = wasm.__wbindgen_externrefs;
|
|
114
|
-
const offset = table.grow(4);
|
|
115
|
-
table.set(0, undefined);
|
|
116
|
-
table.set(offset + 0, undefined);
|
|
117
|
-
table.set(offset + 1, null);
|
|
118
|
-
table.set(offset + 2, true);
|
|
119
|
-
table.set(offset + 3, false);
|
|
154
|
+
return addHeapObject(ret);
|
|
120
155
|
},
|
|
121
156
|
};
|
|
122
157
|
return {
|
|
@@ -125,11 +160,34 @@ function __wbg_get_imports() {
|
|
|
125
160
|
};
|
|
126
161
|
}
|
|
127
162
|
|
|
163
|
+
function addHeapObject(obj) {
|
|
164
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
165
|
+
const idx = heap_next;
|
|
166
|
+
heap_next = heap[idx];
|
|
167
|
+
|
|
168
|
+
heap[idx] = obj;
|
|
169
|
+
return idx;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function dropObject(idx) {
|
|
173
|
+
if (idx < 1028) return;
|
|
174
|
+
heap[idx] = heap_next;
|
|
175
|
+
heap_next = idx;
|
|
176
|
+
}
|
|
177
|
+
|
|
128
178
|
function getArrayU8FromWasm0(ptr, len) {
|
|
129
179
|
ptr = ptr >>> 0;
|
|
130
180
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
131
181
|
}
|
|
132
182
|
|
|
183
|
+
let cachedDataViewMemory0 = null;
|
|
184
|
+
function getDataViewMemory0() {
|
|
185
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
186
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
187
|
+
}
|
|
188
|
+
return cachedDataViewMemory0;
|
|
189
|
+
}
|
|
190
|
+
|
|
133
191
|
function getStringFromWasm0(ptr, len) {
|
|
134
192
|
ptr = ptr >>> 0;
|
|
135
193
|
return decodeText(ptr, len);
|
|
@@ -143,6 +201,13 @@ function getUint8ArrayMemory0() {
|
|
|
143
201
|
return cachedUint8ArrayMemory0;
|
|
144
202
|
}
|
|
145
203
|
|
|
204
|
+
function getObject(idx) { return heap[idx]; }
|
|
205
|
+
|
|
206
|
+
let heap = new Array(1024).fill(undefined);
|
|
207
|
+
heap.push(undefined, null, true, false);
|
|
208
|
+
|
|
209
|
+
let heap_next = heap.length;
|
|
210
|
+
|
|
146
211
|
function passArray8ToWasm0(arg, malloc) {
|
|
147
212
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
148
213
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -150,10 +215,10 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
150
215
|
return ptr;
|
|
151
216
|
}
|
|
152
217
|
|
|
153
|
-
function
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
return
|
|
218
|
+
function takeObject(idx) {
|
|
219
|
+
const ret = getObject(idx);
|
|
220
|
+
dropObject(idx);
|
|
221
|
+
return ret;
|
|
157
222
|
}
|
|
158
223
|
|
|
159
224
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -168,4 +233,3 @@ const wasmPath = `${__dirname}/axlsign_wasm_bg.wasm`;
|
|
|
168
233
|
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
169
234
|
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
170
235
|
let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
|
|
171
|
-
wasm.__wbindgen_start();
|
|
Binary file
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const axlsignPublicKey: (a: number, b: number
|
|
5
|
-
export const axlsignSharedKey: (a: number, b: number, c: number, d: number
|
|
6
|
-
export const axlsignSign: (a: number, b: number, c: number, d: number
|
|
7
|
-
export const axlsignSignRnd: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
8
|
-
export const axlsignVerify: (a: number, b: number, c: number, d: number, e: number, f: number
|
|
9
|
-
export const
|
|
10
|
-
export const
|
|
11
|
-
export const
|
|
12
|
-
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
13
|
-
export const __wbindgen_start: () => void;
|
|
4
|
+
export const axlsignPublicKey: (a: number, b: number, c: number) => void;
|
|
5
|
+
export const axlsignSharedKey: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
6
|
+
export const axlsignSign: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
7
|
+
export const axlsignSignRnd: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
8
|
+
export const axlsignVerify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
9
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
10
|
+
export const __wbindgen_export: (a: number, b: number) => number;
|
|
11
|
+
export const __wbindgen_export2: (a: number, b: number, c: number) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as axlsignApi from "./axlsign.js";
|
|
2
|
-
import * as wasmApi from "./wasm.js";
|
|
3
2
|
import * as ed25519Api from "./ed25519.js";
|
|
4
3
|
import * as x25519Api from "./x25519.js";
|
|
5
4
|
import type { Bytes32, Bytes64 } from "./types.js";
|
|
@@ -37,7 +36,7 @@ export declare const ed25519: {
|
|
|
37
36
|
readonly openMessage: typeof ed25519Api.openMessage;
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
40
|
-
*
|
|
39
|
+
* Legacy-compatible axlsign namespace, accelerated by internal Rust/WASM bindings.
|
|
41
40
|
*/
|
|
42
41
|
export declare const axlsign: {
|
|
43
42
|
readonly publicKey: typeof axlsignApi.publicKey;
|
|
@@ -48,36 +47,6 @@ export declare const axlsign: {
|
|
|
48
47
|
readonly signMessage: typeof axlsignApi.signMessage;
|
|
49
48
|
readonly openMessage: typeof axlsignApi.openMessage;
|
|
50
49
|
};
|
|
51
|
-
/**
|
|
52
|
-
* Optional modern WASM namespace with X25519 + Ed25519 parity methods.
|
|
53
|
-
*/
|
|
54
|
-
export declare const wasm: {
|
|
55
|
-
readonly x25519: {
|
|
56
|
-
readonly createPrivateKeyObject: typeof wasmApi.x25519CreatePrivateKeyObject;
|
|
57
|
-
readonly createPublicKeyObject: typeof wasmApi.x25519CreatePublicKeyObject;
|
|
58
|
-
readonly publicKeyFromPrivateKeyObject: typeof wasmApi.x25519PublicKeyFromPrivateKeyObject;
|
|
59
|
-
readonly publicKey: typeof wasmApi.x25519PublicKey;
|
|
60
|
-
readonly sharedKey: typeof wasmApi.x25519SharedKey;
|
|
61
|
-
readonly sharedKeyFromKeyObjects: typeof wasmApi.x25519SharedKeyFromKeyObjects;
|
|
62
|
-
readonly sharedKeyStrict: typeof wasmApi.x25519SharedKeyStrict;
|
|
63
|
-
readonly sharedKeyStrictFromKeyObjects: typeof wasmApi.x25519SharedKeyStrictFromKeyObjects;
|
|
64
|
-
readonly isAllZero32: typeof wasmApi.isAllZero32;
|
|
65
|
-
readonly generateKeyPair: typeof wasmApi.x25519GenerateKeyPair;
|
|
66
|
-
};
|
|
67
|
-
readonly ed25519: {
|
|
68
|
-
readonly createPrivateKeyObject: typeof wasmApi.ed25519CreatePrivateKeyObject;
|
|
69
|
-
readonly createPublicKeyObject: typeof wasmApi.ed25519CreatePublicKeyObject;
|
|
70
|
-
readonly publicKeyFromPrivateKeyObject: typeof wasmApi.ed25519PublicKeyFromPrivateKeyObject;
|
|
71
|
-
readonly publicKey: typeof wasmApi.ed25519PublicKey;
|
|
72
|
-
readonly generateKeyPair: typeof wasmApi.ed25519GenerateKeyPair;
|
|
73
|
-
readonly sign: typeof wasmApi.ed25519Sign;
|
|
74
|
-
readonly signWithPrivateKey: typeof wasmApi.ed25519SignWithPrivateKey;
|
|
75
|
-
readonly verify: typeof wasmApi.ed25519Verify;
|
|
76
|
-
readonly verifyWithPublicKey: typeof wasmApi.ed25519VerifyWithPublicKey;
|
|
77
|
-
readonly signMessage: typeof wasmApi.ed25519SignMessage;
|
|
78
|
-
readonly openMessage: typeof wasmApi.ed25519OpenMessage;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
50
|
/**
|
|
82
51
|
* Top-level compatibility alias for X25519 shared secret.
|
|
83
52
|
*/
|
|
@@ -151,33 +120,6 @@ declare const api: {
|
|
|
151
120
|
readonly signMessage: typeof axlsignApi.signMessage;
|
|
152
121
|
readonly openMessage: typeof axlsignApi.openMessage;
|
|
153
122
|
};
|
|
154
|
-
readonly wasm: {
|
|
155
|
-
readonly x25519: {
|
|
156
|
-
readonly createPrivateKeyObject: typeof wasmApi.x25519CreatePrivateKeyObject;
|
|
157
|
-
readonly createPublicKeyObject: typeof wasmApi.x25519CreatePublicKeyObject;
|
|
158
|
-
readonly publicKeyFromPrivateKeyObject: typeof wasmApi.x25519PublicKeyFromPrivateKeyObject;
|
|
159
|
-
readonly publicKey: typeof wasmApi.x25519PublicKey;
|
|
160
|
-
readonly sharedKey: typeof wasmApi.x25519SharedKey;
|
|
161
|
-
readonly sharedKeyFromKeyObjects: typeof wasmApi.x25519SharedKeyFromKeyObjects;
|
|
162
|
-
readonly sharedKeyStrict: typeof wasmApi.x25519SharedKeyStrict;
|
|
163
|
-
readonly sharedKeyStrictFromKeyObjects: typeof wasmApi.x25519SharedKeyStrictFromKeyObjects;
|
|
164
|
-
readonly isAllZero32: typeof wasmApi.isAllZero32;
|
|
165
|
-
readonly generateKeyPair: typeof wasmApi.x25519GenerateKeyPair;
|
|
166
|
-
};
|
|
167
|
-
readonly ed25519: {
|
|
168
|
-
readonly createPrivateKeyObject: typeof wasmApi.ed25519CreatePrivateKeyObject;
|
|
169
|
-
readonly createPublicKeyObject: typeof wasmApi.ed25519CreatePublicKeyObject;
|
|
170
|
-
readonly publicKeyFromPrivateKeyObject: typeof wasmApi.ed25519PublicKeyFromPrivateKeyObject;
|
|
171
|
-
readonly publicKey: typeof wasmApi.ed25519PublicKey;
|
|
172
|
-
readonly generateKeyPair: typeof wasmApi.ed25519GenerateKeyPair;
|
|
173
|
-
readonly sign: typeof wasmApi.ed25519Sign;
|
|
174
|
-
readonly signWithPrivateKey: typeof wasmApi.ed25519SignWithPrivateKey;
|
|
175
|
-
readonly verify: typeof wasmApi.ed25519Verify;
|
|
176
|
-
readonly verifyWithPublicKey: typeof wasmApi.ed25519VerifyWithPublicKey;
|
|
177
|
-
readonly signMessage: typeof wasmApi.ed25519SignMessage;
|
|
178
|
-
readonly openMessage: typeof wasmApi.ed25519OpenMessage;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
123
|
readonly sharedKey: typeof x25519Api.sharedKey;
|
|
182
124
|
readonly sharedKeyStrict: typeof x25519Api.sharedKeyStrict;
|
|
183
125
|
readonly generateKeyPair: typeof x25519Api.generateKeyPair;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1F,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;CAWT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;CAQV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS,4BAAmB,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,eAAe,kCAAyB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,eAAe,kCAAyB,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,qBAAqB,kCAAyB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,sBAAsB,mCAA0B,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAI7F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,OAAO,EACrB,GAAG,EAAE,UAAU,EACf,UAAU,CAAC,EAAE,UAAU,GACtB,UAAU,CAIZ;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,+BAAsB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,MAAM,0BAAiB,CAAC;AAErC,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAaC,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { assertNoOptRandom, assertUint8Array } from "./internal/assert.js";
|
|
2
2
|
import * as axlsignApi from "./axlsign.js";
|
|
3
|
-
import * as wasmApi from "./wasm.js";
|
|
4
3
|
import * as ed25519Api from "./ed25519.js";
|
|
5
4
|
import * as x25519Api from "./x25519.js";
|
|
6
5
|
export { asBytes32, asBytes64, assertBytes32, assertBytes64 } from "./internal/assert.js";
|
|
@@ -36,7 +35,7 @@ export const ed25519 = {
|
|
|
36
35
|
openMessage: ed25519Api.openMessage,
|
|
37
36
|
};
|
|
38
37
|
/**
|
|
39
|
-
*
|
|
38
|
+
* Legacy-compatible axlsign namespace, accelerated by internal Rust/WASM bindings.
|
|
40
39
|
*/
|
|
41
40
|
export const axlsign = {
|
|
42
41
|
publicKey: axlsignApi.publicKey,
|
|
@@ -47,13 +46,6 @@ export const axlsign = {
|
|
|
47
46
|
signMessage: axlsignApi.signMessage,
|
|
48
47
|
openMessage: axlsignApi.openMessage,
|
|
49
48
|
};
|
|
50
|
-
/**
|
|
51
|
-
* Optional modern WASM namespace with X25519 + Ed25519 parity methods.
|
|
52
|
-
*/
|
|
53
|
-
export const wasm = {
|
|
54
|
-
x25519: wasmApi.x25519,
|
|
55
|
-
ed25519: wasmApi.ed25519,
|
|
56
|
-
};
|
|
57
49
|
/**
|
|
58
50
|
* Top-level compatibility alias for X25519 shared secret.
|
|
59
51
|
*/
|
|
@@ -104,7 +96,6 @@ const api = {
|
|
|
104
96
|
x25519,
|
|
105
97
|
ed25519,
|
|
106
98
|
axlsign,
|
|
107
|
-
wasm,
|
|
108
99
|
sharedKey,
|
|
109
100
|
sharedKeyStrict,
|
|
110
101
|
generateKeyPair,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1F;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,sBAAsB,EAAE,SAAS,CAAC,sBAAsB;IACxD,qBAAqB,EAAE,SAAS,CAAC,qBAAqB;IACtD,6BAA6B,EAAE,SAAS,CAAC,6BAA6B;IACtE,SAAS,EAAE,SAAS,CAAC,SAAS;IAC9B,SAAS,EAAE,SAAS,CAAC,SAAS;IAC9B,uBAAuB,EAAE,SAAS,CAAC,uBAAuB;I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AG,MAAM,CAAC,eAAe,CAAC;AAE5D;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,eAAe,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,YAAqB,EAAE,GAAe,EAAE,UAAuB;IAClF,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,iBAAiB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,YAAqB,EACrB,GAAe,EACf,UAAuB;IAEvB,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC7C,OAAO,OAAO,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAErC,MAAM,GAAG,GAAG;IACV,MAAM;IACN,OAAO;IACP,OAAO;IACP,SAAS;IACT,eAAe;IACf,eAAe;IACf,qBAAqB;IACrB,sBAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW;IACX,MAAM;CACE,CAAC;AAEX,eAAe,GAAG,CAAC"}
|
package/dist/internal/assert.js
CHANGED
|
@@ -27,7 +27,7 @@ export function asBytes64(value, name = "value") {
|
|
|
27
27
|
}
|
|
28
28
|
export function assertNoOptRandom(optRandom, fnName) {
|
|
29
29
|
if (optRandom !== undefined) {
|
|
30
|
-
throw new Error(`${fnName} does not support opt_random with
|
|
30
|
+
throw new Error(`${fnName} does not support opt_random with Ed25519. ` +
|
|
31
31
|
"Remove the third argument and use deterministic Ed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