@unknownncat/curve25519-node 1.0.0 → 2.0.0

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.
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.publicKey = publicKey;
4
+ exports.sharedKey = sharedKey;
5
+ exports.generateKeyPair = generateKeyPair;
6
+ exports.sign = sign;
7
+ exports.verify = verify;
8
+ exports.signMessage = signMessage;
9
+ exports.openMessage = openMessage;
10
+ const assert_js_1 = require("./internal/assert.js");
11
+ const wasmAxl = require("./internal/axlsign-wasm/axlsign_wasm.js");
12
+ function clampScalar(seed32) {
13
+ const out = new Uint8Array(32);
14
+ out.set(seed32);
15
+ out[0] = (out[0] ?? 0) & 248;
16
+ const last = out[31] ?? 0;
17
+ out[31] = (last & 127) | 64;
18
+ return (0, assert_js_1.asBytes32)(out, "clamped scalar");
19
+ }
20
+ function assertOptionalRandom64(value, fnName) {
21
+ if (value === undefined)
22
+ return;
23
+ (0, assert_js_1.assertBytes64)(value, `${fnName} opt_random`);
24
+ }
25
+ /**
26
+ * Derives an axlsign-compatible public key (Montgomery/X25519 format).
27
+ */
28
+ function publicKey(secretKey32) {
29
+ (0, assert_js_1.assertBytes32)(secretKey32, "secretKey32");
30
+ const out = wasmAxl.axlsignPublicKey(secretKey32);
31
+ return (0, assert_js_1.asBytes32)(out, "axlsign public key");
32
+ }
33
+ /**
34
+ * Computes an axlsign-compatible X25519 shared key.
35
+ */
36
+ function sharedKey(secretKey32, publicKey32) {
37
+ (0, assert_js_1.assertBytes32)(secretKey32, "secretKey32");
38
+ (0, assert_js_1.assertBytes32)(publicKey32, "publicKey32");
39
+ const out = wasmAxl.axlsignSharedKey(secretKey32, publicKey32);
40
+ return (0, assert_js_1.asBytes32)(out, "axlsign shared key");
41
+ }
42
+ /**
43
+ * Generates an axlsign-compatible key pair from a 32-byte seed.
44
+ */
45
+ function generateKeyPair(seed32) {
46
+ (0, assert_js_1.assertBytes32)(seed32, "seed32");
47
+ const privateKey = clampScalar(seed32);
48
+ const publicKey32 = publicKey(privateKey);
49
+ return {
50
+ public: publicKey32,
51
+ private: privateKey,
52
+ };
53
+ }
54
+ /**
55
+ * Detached axlsign signature using X25519-format secret key.
56
+ * opt_random (64 bytes) enables randomized signing as in curve25519-js.
57
+ */
58
+ function sign(secretKey32, msg, opt_random) {
59
+ (0, assert_js_1.assertBytes32)(secretKey32, "secretKey32");
60
+ (0, assert_js_1.assertUint8Array)(msg, "msg");
61
+ assertOptionalRandom64(opt_random, "sign");
62
+ const signature = opt_random === undefined
63
+ ? wasmAxl.axlsignSign(secretKey32, msg)
64
+ : wasmAxl.axlsignSignRnd(secretKey32, msg, opt_random);
65
+ return (0, assert_js_1.asBytes64)(signature, "axlsign signature");
66
+ }
67
+ /**
68
+ * Verifies detached axlsign signature.
69
+ */
70
+ function verify(publicKey32, msg, signature64) {
71
+ (0, assert_js_1.assertBytes32)(publicKey32, "publicKey32");
72
+ (0, assert_js_1.assertUint8Array)(msg, "msg");
73
+ (0, assert_js_1.assertBytes64)(signature64, "signature64");
74
+ return wasmAxl.axlsignVerify(publicKey32, msg, signature64);
75
+ }
76
+ /**
77
+ * Returns signature || message (axlsign mode).
78
+ */
79
+ function signMessage(secretKey32, msg, opt_random) {
80
+ (0, assert_js_1.assertBytes32)(secretKey32, "secretKey32");
81
+ (0, assert_js_1.assertUint8Array)(msg, "msg");
82
+ assertOptionalRandom64(opt_random, "signMessage");
83
+ const signature = sign(secretKey32, msg, opt_random);
84
+ const out = new Uint8Array(64 + msg.byteLength);
85
+ out.set(signature, 0);
86
+ out.set(msg, 64);
87
+ return out;
88
+ }
89
+ /**
90
+ * Verifies signature || message and returns original message on success.
91
+ */
92
+ function openMessage(publicKey32, signedMsg) {
93
+ (0, assert_js_1.assertBytes32)(publicKey32, "publicKey32");
94
+ (0, assert_js_1.assertUint8Array)(signedMsg, "signedMsg");
95
+ if (signedMsg.byteLength < 64) {
96
+ return null;
97
+ }
98
+ const signature64 = (0, assert_js_1.asBytes64)(signedMsg.subarray(0, 64), "signedMsg signature");
99
+ const msg = signedMsg.subarray(64);
100
+ if (!verify(publicKey32, msg, signature64)) {
101
+ return null;
102
+ }
103
+ return new Uint8Array(msg);
104
+ }
105
+ //# sourceMappingURL=axlsign.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axlsign.js","sourceRoot":"","sources":["../../src/axlsign.ts"],"names":[],"mappings":";;AAqBA,8BAIC;AAKD,8BAKC;AAKD,0CAQC;AAMD,oBAUC;AAKD,wBAKC;AAKD,kCAUC;AAKD,kCAeC;AA7GD,oDAA4G;AAE5G,mEAAmE;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,EAAE,gBAAgB,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,sBAAsB,CAAC,KAA6B,EAAE,MAAc;IAC3E,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAChC,IAAA,yBAAa,EAAC,KAAK,EAAE,GAAG,MAAM,aAAa,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,WAAoB;IAC5C,IAAA,yBAAa,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC,WAAW,CA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C,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,9 +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.sharedKey = exports.ed25519 = exports.x25519 = exports.assertBytes64 = exports.assertBytes32 = exports.asBytes64 = exports.asBytes32 = void 0;
3
+ exports.verify = exports.openMessage = exports.generateKeyPairEd25519 = exports.generateKeyPairX25519 = exports.generateKeyPair = 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
+ const axlsignApi = require("./axlsign.js");
7
8
  const ed25519Api = require("./ed25519.js");
8
9
  const x25519Api = require("./x25519.js");
9
10
  var assert_js_2 = require("./internal/assert.js");
@@ -30,6 +31,18 @@ exports.ed25519 = {
30
31
  signMessage: ed25519Api.signMessage,
31
32
  openMessage: ed25519Api.openMessage,
32
33
  };
34
+ /**
35
+ * Optional legacy-compatible axlsign namespace implemented with WASM.
36
+ */
37
+ exports.axlsign = {
38
+ publicKey: axlsignApi.publicKey,
39
+ sharedKey: axlsignApi.sharedKey,
40
+ generateKeyPair: axlsignApi.generateKeyPair,
41
+ sign: axlsignApi.sign,
42
+ verify: axlsignApi.verify,
43
+ signMessage: axlsignApi.signMessage,
44
+ openMessage: axlsignApi.openMessage,
45
+ };
33
46
  /**
34
47
  * Top-level compatibility alias for X25519 shared secret.
35
48
  */
@@ -75,6 +88,7 @@ exports.verify = exports.ed25519.verify;
75
88
  const api = {
76
89
  x25519: exports.x25519,
77
90
  ed25519: exports.ed25519,
91
+ axlsign: exports.axlsign,
78
92
  sharedKey: exports.sharedKey,
79
93
  generateKeyPair: exports.generateKeyPair,
80
94
  generateKeyPairX25519: exports.generateKeyPairX25519,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAqDA,oBAIC;AAMD,kCAIC;AAnED,oDAA2E;AAC3E,2CAA2C;AAC3C,yCAAyC;AAGzC,kDAA0F;AAAjF,sGAAA,SAAS,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,0GAAA,aAAa,OAAA;AAG3D;;GAEG;AACU,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE,SAAS,CAAC,SAAS;IAC9B,SAAS,EAAE,SAAS,CAAC,SAAS;IAC9B,eAAe,EAAE,SAAS,CAAC,eAAe;CAClC,CAAC;AAEX;;GAEG;AACU,QAAA,OAAO,GAAG;IACrB,SAAS,EAAE,UAAU,CAAC,SAAS;IAC/B,eAAe,EAAE,UAAU,CAAC,eAAe;IAC3C,IAAI,EAAE,UAAU,CAAC,IAAI;IACrB,MAAM,EAAE,UAAU,CAAC,MAAM;IACzB,WAAW,EAAE,UAAU,CAAC,WAAW;IACnC,WAAW,EAAE,UAAU,CAAC,WAAW;CAC3B,CAAC;AAEX;;GAEG;AACU,QAAA,SAAS,GAAG,cAAM,CAAC,SAAS,CAAC;AAE1C;;GAEG;AACU,QAAA,eAAe,GAAG,cAAM,CAAC,eAAe,CAAC;AAEtD;;GAEG;AACU,QAAA,qBAAqB,GAAG,cAAM,CAAC,eAAe,CAAC;AAE5D;;GAEG;AACU,QAAA,sBAAsB,GAAG,eAAO,CAAC,eAAe,CAAC;AAE9D;;;GAGG;AACH,SAAgB,IAAI,CAAC,Y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GAAe,EAAE,UAAuB;IACzF,IAAA,4BAAgB,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC7B,IAAA,6BAAiB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC7C,OAAO,eAAO,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACU,QAAA,WAAW,GAAG,eAAO,CAAC,WAAW,CAAC;AAE/C;;GAEG;AACU,QAAA,MAAM,GAAG,eAAO,CAAC,MAAM,CAAC;AAErC,MAAM,GAAG,GAAG;IACV,MAAM,EAAN,cAAM;IACN,OAAO,EAAP,eAAO;IACP,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,eAAe,EAAf,uBAAe;IACf,qBAAqB,EAArB,6BAAqB;IACrB,sBAAsB,EAAtB,8BAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW,EAAX,mBAAW;IACX,MAAM,EAAN,cAAM;CACE,CAAC;AAEX,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sem nome bah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function axlsignPublicKey(secret_key: Uint8Array): Uint8Array;
5
+
6
+ export function axlsignSharedKey(secret_key: Uint8Array, public_key: Uint8Array): Uint8Array;
7
+
8
+ export function axlsignSign(secret_key: Uint8Array, msg: Uint8Array): Uint8Array;
9
+
10
+ export function axlsignSignRnd(secret_key: Uint8Array, msg: Uint8Array, rnd: Uint8Array): Uint8Array;
11
+
12
+ export function axlsignVerify(public_key: Uint8Array, msg: Uint8Array, signature: Uint8Array): boolean;
@@ -0,0 +1,171 @@
1
+ /* @ts-self-types="./axlsign_wasm.d.ts" */
2
+
3
+ /**
4
+ * @param {Uint8Array} secret_key
5
+ * @returns {Uint8Array}
6
+ */
7
+ function axlsignPublicKey(secret_key) {
8
+ const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
9
+ const len0 = WASM_VECTOR_LEN;
10
+ const ret = wasm.axlsignPublicKey(ptr0, len0);
11
+ if (ret[3]) {
12
+ throw takeFromExternrefTable0(ret[2]);
13
+ }
14
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
15
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
16
+ return v2;
17
+ }
18
+ exports.axlsignPublicKey = axlsignPublicKey;
19
+
20
+ /**
21
+ * @param {Uint8Array} secret_key
22
+ * @param {Uint8Array} public_key
23
+ * @returns {Uint8Array}
24
+ */
25
+ function axlsignSharedKey(secret_key, public_key) {
26
+ const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
27
+ const len0 = WASM_VECTOR_LEN;
28
+ const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
29
+ const len1 = WASM_VECTOR_LEN;
30
+ const ret = wasm.axlsignSharedKey(ptr0, len0, ptr1, len1);
31
+ if (ret[3]) {
32
+ throw takeFromExternrefTable0(ret[2]);
33
+ }
34
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
35
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
36
+ return v3;
37
+ }
38
+ exports.axlsignSharedKey = axlsignSharedKey;
39
+
40
+ /**
41
+ * @param {Uint8Array} secret_key
42
+ * @param {Uint8Array} msg
43
+ * @returns {Uint8Array}
44
+ */
45
+ function axlsignSign(secret_key, msg) {
46
+ const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
49
+ const len1 = WASM_VECTOR_LEN;
50
+ const ret = wasm.axlsignSign(ptr0, len0, ptr1, len1);
51
+ if (ret[3]) {
52
+ throw takeFromExternrefTable0(ret[2]);
53
+ }
54
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
55
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
56
+ return v3;
57
+ }
58
+ exports.axlsignSign = axlsignSign;
59
+
60
+ /**
61
+ * @param {Uint8Array} secret_key
62
+ * @param {Uint8Array} msg
63
+ * @param {Uint8Array} rnd
64
+ * @returns {Uint8Array}
65
+ */
66
+ function axlsignSignRnd(secret_key, msg, rnd) {
67
+ const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
68
+ const len0 = WASM_VECTOR_LEN;
69
+ const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
70
+ const len1 = WASM_VECTOR_LEN;
71
+ const ptr2 = passArray8ToWasm0(rnd, wasm.__wbindgen_malloc);
72
+ const len2 = WASM_VECTOR_LEN;
73
+ const ret = wasm.axlsignSignRnd(ptr0, len0, ptr1, len1, ptr2, len2);
74
+ if (ret[3]) {
75
+ throw takeFromExternrefTable0(ret[2]);
76
+ }
77
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
78
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
79
+ return v4;
80
+ }
81
+ exports.axlsignSignRnd = axlsignSignRnd;
82
+
83
+ /**
84
+ * @param {Uint8Array} public_key
85
+ * @param {Uint8Array} msg
86
+ * @param {Uint8Array} signature
87
+ * @returns {boolean}
88
+ */
89
+ function axlsignVerify(public_key, msg, signature) {
90
+ const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
91
+ const len0 = WASM_VECTOR_LEN;
92
+ const ptr1 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
93
+ const len1 = WASM_VECTOR_LEN;
94
+ const ptr2 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
95
+ const len2 = WASM_VECTOR_LEN;
96
+ const ret = wasm.axlsignVerify(ptr0, len0, ptr1, len1, ptr2, len2);
97
+ if (ret[2]) {
98
+ throw takeFromExternrefTable0(ret[1]);
99
+ }
100
+ return ret[0] !== 0;
101
+ }
102
+ exports.axlsignVerify = axlsignVerify;
103
+
104
+ function __wbg_get_imports() {
105
+ const import0 = {
106
+ __proto__: null,
107
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
108
+ // Cast intrinsic for `Ref(String) -> Externref`.
109
+ 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);
120
+ },
121
+ };
122
+ return {
123
+ __proto__: null,
124
+ "./axlsign_wasm_bg.js": import0,
125
+ };
126
+ }
127
+
128
+ function getArrayU8FromWasm0(ptr, len) {
129
+ ptr = ptr >>> 0;
130
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
131
+ }
132
+
133
+ function getStringFromWasm0(ptr, len) {
134
+ ptr = ptr >>> 0;
135
+ return decodeText(ptr, len);
136
+ }
137
+
138
+ let cachedUint8ArrayMemory0 = null;
139
+ function getUint8ArrayMemory0() {
140
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
141
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
142
+ }
143
+ return cachedUint8ArrayMemory0;
144
+ }
145
+
146
+ function passArray8ToWasm0(arg, malloc) {
147
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
148
+ getUint8ArrayMemory0().set(arg, ptr / 1);
149
+ WASM_VECTOR_LEN = arg.length;
150
+ return ptr;
151
+ }
152
+
153
+ function takeFromExternrefTable0(idx) {
154
+ const value = wasm.__wbindgen_externrefs.get(idx);
155
+ wasm.__externref_table_dealloc(idx);
156
+ return value;
157
+ }
158
+
159
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
160
+ cachedTextDecoder.decode();
161
+ function decodeText(ptr, len) {
162
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
163
+ }
164
+
165
+ let WASM_VECTOR_LEN = 0;
166
+
167
+ const wasmPath = `${__dirname}/axlsign_wasm_bg.wasm`;
168
+ const wasmBytes = require('fs').readFileSync(wasmPath);
169
+ const wasmModule = new WebAssembly.Module(wasmBytes);
170
+ let wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
171
+ wasm.__wbindgen_start();
@@ -0,0 +1,13 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const axlsignPublicKey: (a: number, b: number) => [number, number, number, number];
5
+ export const axlsignSharedKey: (a: number, b: number, c: number, d: number) => [number, number, number, number];
6
+ export const axlsignSign: (a: number, b: number, c: number, d: number) => [number, number, number, number];
7
+ export const axlsignSignRnd: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
8
+ export const axlsignVerify: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
9
+ export const __wbindgen_externrefs: WebAssembly.Table;
10
+ export const __wbindgen_malloc: (a: number, b: number) => number;
11
+ export const __externref_table_dealloc: (a: number) => void;
12
+ export const __wbindgen_free: (a: number, b: number, c: number) => void;
13
+ export const __wbindgen_start: () => void;
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "curve25519-node-axlsign",
3
+ "description": "axlsign-compatible primitives for curve25519-node via wasm-bindgen",
4
+ "version": "0.1.0",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/unknownncat/curve25519-node"
9
+ },
10
+ "files": [
11
+ "axlsign_wasm_bg.wasm",
12
+ "axlsign_wasm.js",
13
+ "axlsign_wasm.d.ts"
14
+ ],
15
+ "main": "axlsign_wasm.js",
16
+ "types": "axlsign_wasm.d.ts"
17
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import * as axlsignApi from "./axlsign.js";
1
2
  import * as ed25519Api from "./ed25519.js";
2
3
  import * as x25519Api from "./x25519.js";
3
4
  import type { Bytes32, Bytes64 } from "./types.js";
@@ -22,6 +23,18 @@ export declare const ed25519: {
22
23
  readonly signMessage: typeof ed25519Api.signMessage;
23
24
  readonly openMessage: typeof ed25519Api.openMessage;
24
25
  };
26
+ /**
27
+ * Optional legacy-compatible axlsign namespace implemented with WASM.
28
+ */
29
+ export declare const axlsign: {
30
+ readonly publicKey: typeof axlsignApi.publicKey;
31
+ readonly sharedKey: typeof axlsignApi.sharedKey;
32
+ readonly generateKeyPair: typeof axlsignApi.generateKeyPair;
33
+ readonly sign: typeof axlsignApi.sign;
34
+ readonly verify: typeof axlsignApi.verify;
35
+ readonly signMessage: typeof axlsignApi.signMessage;
36
+ readonly openMessage: typeof axlsignApi.openMessage;
37
+ };
25
38
  /**
26
39
  * Top-level compatibility alias for X25519 shared secret.
27
40
  */
@@ -70,6 +83,15 @@ declare const api: {
70
83
  readonly signMessage: typeof ed25519Api.signMessage;
71
84
  readonly openMessage: typeof ed25519Api.openMessage;
72
85
  };
86
+ readonly axlsign: {
87
+ readonly publicKey: typeof axlsignApi.publicKey;
88
+ readonly sharedKey: typeof axlsignApi.sharedKey;
89
+ readonly generateKeyPair: typeof axlsignApi.generateKeyPair;
90
+ readonly sign: typeof axlsignApi.sign;
91
+ readonly verify: typeof axlsignApi.verify;
92
+ readonly signMessage: typeof axlsignApi.signMessage;
93
+ readonly openMessage: typeof axlsignApi.openMessage;
94
+ };
73
95
  readonly sharedKey: typeof x25519Api.sharedKey;
74
96
  readonly generateKeyPair: typeof x25519Api.generateKeyPair;
75
97
  readonly generateKeyPairX25519: typeof x25519Api.generateKeyPair;
@@ -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,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAa,MAAM,YAAY,CAAC;AAE9D,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;;;;CAIT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS,4BAAmB,CAAC;AAE1C;;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,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O,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAI7F;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAIvG;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,+BAAsB,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,MAAM,0BAAiB,CAAC;AAErC,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYC,CAAC;AAEX,eAAe,GAAG,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { assertNoOptRandom, assertUint8Array } from "./internal/assert.js";
2
+ import * as axlsignApi from "./axlsign.js";
2
3
  import * as ed25519Api from "./ed25519.js";
3
4
  import * as x25519Api from "./x25519.js";
4
5
  export { asBytes32, asBytes64, assertBytes32, assertBytes64 } from "./internal/assert.js";
@@ -21,6 +22,18 @@ export const ed25519 = {
21
22
  signMessage: ed25519Api.signMessage,
22
23
  openMessage: ed25519Api.openMessage,
23
24
  };
25
+ /**
26
+ * Optional legacy-compatible axlsign namespace implemented with WASM.
27
+ */
28
+ export const axlsign = {
29
+ publicKey: axlsignApi.publicKey,
30
+ sharedKey: axlsignApi.sharedKey,
31
+ generateKeyPair: axlsignApi.generateKeyPair,
32
+ sign: axlsignApi.sign,
33
+ verify: axlsignApi.verify,
34
+ signMessage: axlsignApi.signMessage,
35
+ openMessage: axlsignApi.openMessage,
36
+ };
24
37
  /**
25
38
  * Top-level compatibility alias for X25519 shared secret.
26
39
  */
@@ -66,6 +79,7 @@ export const verify = ed25519.verify;
66
79
  const api = {
67
80
  x25519,
68
81
  ed25519,
82
+ axlsign,
69
83
  sharedKey,
70
84
  generateKeyPair,
71
85
  generateKeyPairX25519,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRo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,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,qBAAqB;IACrB,sBAAsB;IACtB,IAAI;IACJ,WAAW;IACX,WAAW;IACX,MAAM;CACE,CAAC;AAEX,eAAe,GAAG,CAAC"}
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sem nome bah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function axlsignPublicKey(secret_key: Uint8Array): Uint8Array;
5
+
6
+ export function axlsignSharedKey(secret_key: Uint8Array, public_key: Uint8Array): Uint8Array;
7
+
8
+ export function axlsignSign(secret_key: Uint8Array, msg: Uint8Array): Uint8Array;
9
+
10
+ export function axlsignSignRnd(secret_key: Uint8Array, msg: Uint8Array, rnd: Uint8Array): Uint8Array;
11
+
12
+ export function axlsignVerify(public_key: Uint8Array, msg: Uint8Array, signature: Uint8Array): boolean;