@unknownncat/curve25519-node 2.1.1 → 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.
Files changed (44) hide show
  1. package/NOTICE.md +6 -6
  2. package/README.en.md +34 -407
  3. package/README.md +35 -408
  4. package/dist/axlsign.d.ts +1 -1
  5. package/dist/axlsign.d.ts.map +1 -1
  6. package/dist/axlsign.js +8 -50
  7. package/dist/axlsign.js.map +1 -1
  8. package/dist/cjs/axlsign.js +8 -50
  9. package/dist/cjs/axlsign.js.map +1 -1
  10. package/dist/cjs/index.js +2 -11
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/internal/assert.js +1 -1
  13. package/dist/cjs/internal/assert.js.map +1 -1
  14. package/dist/cjs/internal/axlsign-wasm/axlsign_wasm.js +129 -65
  15. package/dist/cjs/internal/axlsign-wasm/axlsign_wasm_bg.wasm +0 -0
  16. package/dist/cjs/internal/axlsign-wasm/axlsign_wasm_bg.wasm.d.ts +8 -10
  17. package/dist/index.d.ts +1 -59
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1 -10
  20. package/dist/index.js.map +1 -1
  21. package/dist/internal/assert.js +1 -1
  22. package/dist/internal/assert.js.map +1 -1
  23. package/dist/internal/axlsign-wasm/axlsign_wasm.js +129 -65
  24. package/dist/internal/axlsign-wasm/axlsign_wasm_bg.wasm +0 -0
  25. package/dist/internal/axlsign-wasm/axlsign_wasm_bg.wasm.d.ts +8 -10
  26. package/package.json +8 -24
  27. package/dist/cjs/internal/curve25519-wasm/LICENSE +0 -21
  28. package/dist/cjs/internal/curve25519-wasm/curve25519_wasm.d.ts +0 -12
  29. package/dist/cjs/internal/curve25519-wasm/curve25519_wasm.js +0 -165
  30. package/dist/cjs/internal/curve25519-wasm/curve25519_wasm_bg.wasm +0 -0
  31. package/dist/cjs/internal/curve25519-wasm/curve25519_wasm_bg.wasm.d.ts +0 -13
  32. package/dist/cjs/internal/curve25519-wasm/package.json +0 -17
  33. package/dist/cjs/wasm.js +0 -249
  34. package/dist/cjs/wasm.js.map +0 -1
  35. package/dist/internal/curve25519-wasm/LICENSE +0 -21
  36. package/dist/internal/curve25519-wasm/curve25519_wasm.d.ts +0 -12
  37. package/dist/internal/curve25519-wasm/curve25519_wasm.js +0 -165
  38. package/dist/internal/curve25519-wasm/curve25519_wasm_bg.wasm +0 -0
  39. package/dist/internal/curve25519-wasm/curve25519_wasm_bg.wasm.d.ts +0 -13
  40. package/dist/internal/curve25519-wasm/package.json +0 -17
  41. package/dist/wasm.d.ts +0 -92
  42. package/dist/wasm.d.ts.map +0 -1
  43. package/dist/wasm.js +0 -225
  44. package/dist/wasm.js.map +0 -1
package/README.md CHANGED
@@ -1,438 +1,65 @@
1
1
  # @unknownncat/curve25519-node
2
2
 
3
- > 🇺🇸 English version: [README.en.md](./README.en.md)
3
+ > English version: [README.en.md](./README.en.md)
4
4
 
5
- Implementação sem dependências de runtime de:
5
+ Implementacao para Node.js com API limpa:
6
6
 
7
- - X25519 + Ed25519 (modo moderno via OpenSSL em `node:crypto`)
8
- - X25519 + Ed25519 (modo moderno opcional via WASM)
9
- - axlsign legado (modo opcional via WASM, compatível com `curve25519-js`)
7
+ - `x25519` e `ed25519` via `node:crypto` (OpenSSL)
8
+ - `axlsign` compativel com legado, acelerado por backend Rust/WASM interno
9
+ - sem namespace `wasm`
10
+ - sem namespace `napi`
10
11
 
11
- [![npm](https://img.shields.io/npm/v/@unknownncat/curve25519-node)](https://www.npmjs.com/package/@unknownncat/curve25519-node)
12
- [![node](https://img.shields.io/badge/node-%3E%3D20-339933?logo=node.js&logoColor=white)](https://nodejs.org/)
13
- [![types](https://img.shields.io/badge/types-included-blue)](./dist/index.d.ts)
14
- ![runtime deps](https://img.shields.io/badge/runtime%20deps-0-brightgreen)
15
- ![esm+cjs](https://img.shields.io/badge/ESM%20%2B%20CJS-compatible-blue)
16
- [![license](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
17
-
18
- - Node: `>= 20`
19
- - Dependências de runtime: `0`
20
- - TypeScript: `strict`
21
- - Formatos de módulo: ESM + CJS
22
-
23
- ---
24
-
25
- ## Instalação
12
+ ## Instalar
26
13
 
27
14
  ```bash
28
15
  npm i @unknownncat/curve25519-node
29
16
  ```
30
17
 
31
- ---
32
-
33
- ## Uso Rápido
18
+ ## Uso rapido
34
19
 
35
20
  ```ts
36
21
  import { randomBytes } from "node:crypto";
37
- import { asBytes32, x25519, ed25519 } from "@unknownncat/curve25519-node";
22
+ import { asBytes32, x25519, ed25519, axlsign } from "@unknownncat/curve25519-node";
38
23
 
39
- const aliceSeed = asBytes32(randomBytes(32));
40
- const bobSeed = asBytes32(randomBytes(32));
24
+ const seedA = asBytes32(randomBytes(32));
25
+ const seedB = asBytes32(randomBytes(32));
41
26
 
42
- const aliceX = x25519.generateKeyPair(aliceSeed);
43
- const bobX = x25519.generateKeyPair(bobSeed);
27
+ const alice = x25519.generateKeyPair(seedA);
28
+ const bob = x25519.generateKeyPair(seedB);
29
+ const shared = x25519.sharedKey(alice.private, bob.public);
44
30
 
45
- const segredo1 = x25519.sharedKey(aliceX.private, bobX.public);
46
- const segredo2 = x25519.sharedKey(bobX.private, aliceX.public);
47
- // segredo1 === segredo2
48
-
49
- const signerSeed = asBytes32(randomBytes(32));
50
- const signer = ed25519.generateKeyPair(signerSeed);
51
31
  const msg = new TextEncoder().encode("hello");
32
+ const sig = ed25519.sign(seedA, msg);
33
+ const ok = ed25519.verify(ed25519.publicKey(seedA), msg, sig);
52
34
 
53
- const sig = ed25519.sign(signerSeed, msg);
54
- const ok = ed25519.verify(signer.public, msg, sig);
35
+ const axlSig = axlsign.sign(alice.private, msg, randomBytes(64));
36
+ const axlOk = axlsign.verify(alice.public, msg, axlSig);
55
37
  ```
56
38
 
57
39
  CommonJS:
58
40
 
59
41
  ```js
60
- const { x25519, ed25519, asBytes32 } = require("@unknownncat/curve25519-node");
61
- ```
62
-
63
- Legado axlsign via WASM:
64
-
65
- ```ts
66
- import { asBytes32, axlsign } from "@unknownncat/curve25519-node";
67
-
68
- const seed = asBytes32(new Uint8Array(32));
69
- const kp = axlsign.generateKeyPair(seed); // X25519 keypair compatível com curve25519-js
70
- const sig = axlsign.sign(kp.private, new TextEncoder().encode("hello"), new Uint8Array(64));
71
- const ok = axlsign.verify(kp.public, new TextEncoder().encode("hello"), sig);
72
- ```
73
-
74
- Moderno via WASM (`wasm`):
75
-
76
- ```ts
77
- import { asBytes32, wasm } from "@unknownncat/curve25519-node";
78
-
79
- const seed = asBytes32(new Uint8Array(32));
80
- const kp = wasm.x25519.generateKeyPair(seed);
81
- const shared = wasm.x25519.sharedKey(kp.private, kp.public);
82
-
83
- const msg = new TextEncoder().encode("hello");
84
- const sig = wasm.ed25519.sign(seed, msg);
85
- const ok = wasm.ed25519.verify(wasm.ed25519.publicKey(seed), msg, sig);
86
- ```
87
-
88
- ---
89
-
90
- ## API
91
-
92
- ### `x25519`
93
-
94
- - `createPrivateKeyObject(secretKey32: Bytes32): KeyObject`
95
- - `createPublicKeyObject(publicKey32: Bytes32): KeyObject`
96
- - `publicKeyFromPrivateKeyObject(privateKey: KeyObject): Bytes32`
97
- - `publicKey(secretKey32: Bytes32): Bytes32`
98
- - `sharedKeyFromKeyObjects(privateKey: KeyObject, publicKey: KeyObject): Bytes32`
99
- - `sharedKey(secretKey32: Bytes32, publicKey32: Bytes32): Bytes32`
100
- - `sharedKeyStrict(secretKey32: Bytes32, publicKey32: Bytes32): Bytes32` (rejeita segredo all-zero)
101
- - `sharedKeyStrictFromKeyObjects(privateKey: KeyObject, publicKey: KeyObject): Bytes32` (rejeita segredo all-zero)
102
- - `isAllZero32(bytes32: Bytes32): boolean`
103
- - `generateKeyPair(seed32: Bytes32): { public: Bytes32; private: Bytes32 }`
104
-
105
- ### `ed25519`
106
-
107
- - `createPrivateKeyObject(secretSeed32: Bytes32): KeyObject`
108
- - `createPublicKeyObject(publicKey32: Bytes32): KeyObject`
109
- - `publicKeyFromPrivateKeyObject(privateKey: KeyObject): Bytes32`
110
- - `publicKey(secretSeed32: Bytes32): Bytes32`
111
- - `generateKeyPair(seed32: Bytes32): { public: Bytes32; private: Bytes32 }`
112
- - `sign(secretSeed32: Bytes32, msg: Uint8Array): Bytes64`
113
- - `signWithPrivateKey(privateKey: KeyObject, msg: Uint8Array): Bytes64`
114
- - `verify(publicKey32: Bytes32, msg: Uint8Array, signature64: Bytes64): boolean`
115
- - `verifyWithPublicKey(publicKey: KeyObject, msg: Uint8Array, signature64: Bytes64): boolean`
116
- - `signMessage(secretSeed32: Bytes32, msg: Uint8Array): Uint8Array` (`assinatura || mensagem`)
117
- - `openMessage(publicKey32: Bytes32, signedMsg: Uint8Array): Uint8Array | null`
118
-
119
- ### `axlsign` (compatibilidade legado, via WASM)
120
-
121
- - `publicKey(secretKey32: Bytes32): Bytes32`
122
- - `sharedKey(secretKey32: Bytes32, publicKey32: Bytes32): Bytes32`
123
- - `generateKeyPair(seed32: Bytes32): { public: Bytes32; private: Bytes32 }`
124
- - `sign(secretKey32: Bytes32, msg: Uint8Array, opt_random?: Bytes64): Bytes64`
125
- - `verify(publicKey32: Bytes32, msg: Uint8Array, signature64: Bytes64): boolean`
126
- - `signMessage(secretKey32: Bytes32, msg: Uint8Array, opt_random?: Bytes64): Uint8Array`
127
- - `openMessage(publicKey32: Bytes32, signedMsg: Uint8Array): Uint8Array | null`
128
-
129
- ### `wasm` (modo moderno opcional, via WASM)
130
-
131
- `wasm.x25519`:
132
-
133
- - `createPrivateKeyObject(secretKey32: Bytes32): WasmX25519PrivateKeyObject`
134
- - `createPublicKeyObject(publicKey32: Bytes32): WasmX25519PublicKeyObject`
135
- - `publicKeyFromPrivateKeyObject(privateKey: WasmX25519PrivateKeyObject): Bytes32`
136
- - `publicKey(secretKey32: Bytes32): Bytes32`
137
- - `sharedKeyFromKeyObjects(privateKey: WasmX25519PrivateKeyObject, publicKey: WasmX25519PublicKeyObject): Bytes32`
138
- - `sharedKey(secretKey32: Bytes32, publicKey32: Bytes32): Bytes32`
139
- - `sharedKeyStrict(secretKey32: Bytes32, publicKey32: Bytes32): Bytes32` (rejeita segredo all-zero)
140
- - `sharedKeyStrictFromKeyObjects(privateKey: WasmX25519PrivateKeyObject, publicKey: WasmX25519PublicKeyObject): Bytes32` (rejeita segredo all-zero)
141
- - `isAllZero32(bytes32: Bytes32): boolean`
142
- - `generateKeyPair(seed32: Bytes32): { public: Bytes32; private: Bytes32 }`
143
-
144
- `wasm.ed25519`:
145
-
146
- - `createPrivateKeyObject(secretSeed32: Bytes32): WasmEd25519PrivateKeyObject`
147
- - `createPublicKeyObject(publicKey32: Bytes32): WasmEd25519PublicKeyObject`
148
- - `publicKeyFromPrivateKeyObject(privateKey: WasmEd25519PrivateKeyObject): Bytes32`
149
- - `publicKey(secretSeed32: Bytes32): Bytes32`
150
- - `generateKeyPair(seed32: Bytes32): { public: Bytes32; private: Bytes32 }`
151
- - `sign(secretSeed32: Bytes32, msg: Uint8Array): Bytes64`
152
- - `signWithPrivateKey(privateKey: WasmEd25519PrivateKeyObject, msg: Uint8Array): Bytes64`
153
- - `verify(publicKey32: Bytes32, msg: Uint8Array, signature64: Bytes64): boolean`
154
- - `verifyWithPublicKey(publicKey: WasmEd25519PublicKeyObject, msg: Uint8Array, signature64: Bytes64): boolean`
155
- - `signMessage(secretSeed32: Bytes32, msg: Uint8Array): Uint8Array`
156
- - `openMessage(publicKey32: Bytes32, signedMsg: Uint8Array): Uint8Array | null`
157
-
158
- ### Aliases de compatibilidade (top-level)
159
-
160
- - `sharedKey = x25519.sharedKey`
161
- - `sharedKeyStrict = x25519.sharedKeyStrict`
162
- - `generateKeyPair = x25519.generateKeyPair`
163
- - `sign`, `verify`, `signMessage`, `openMessage` (semântica Ed25519)
164
- - `generateKeyPairX25519`, `generateKeyPairEd25519`
165
-
166
- ---
167
-
168
- ## Notas de Compatibilidade
169
-
170
- Este pacote suporta três modos:
171
-
172
- - **moderno nativo (recomendado):** `x25519` + `ed25519` via `node:crypto`
173
- - **moderno WASM (opcional):** namespace `wasm` (`wasm.x25519` + `wasm.ed25519`)
174
- - **legado:** `axlsign` via WASM para compatibilidade com `curve25519-js`
175
-
176
- | Recurso | `curve25519-js` | `curve25519-node` |
177
- | ----------------------------------- | --------------- | -------------------------------------------- |
178
- | Esquema de assinatura (moderno) | axlsign | Ed25519 (padrão) |
179
- | Esquema moderno alternativo | não | Ed25519 via WASM (`wasm.ed25519`) |
180
- | Esquema de assinatura (legado) | axlsign | axlsign (namespace `axlsign`) |
181
- | Acordo de chave | X25519 | X25519 |
182
- | Acordo moderno alternativo | não | X25519 via WASM (`wasm.x25519`) |
183
- | Mesma chave para assinatura + ECDH | sim | apenas no namespace `axlsign` |
184
- | `opt_random` nas APIs de assinatura | sim | sim no `axlsign`, não no top-level/`ed25519` |
185
- | Backend OpenSSL | não | sim |
186
-
187
- Importante:
188
-
189
- - Chaves públicas X25519 e Ed25519 são diferentes.
190
- - Para fluxos de protocolo mais rígidos (estilo Signal), prefira `sharedKeyStrict` para rejeitar segredo compartilhado all-zero.
191
- - `node:crypto` não expõe API para converter public key X25519 ↔ Ed25519.
192
- - Top-level `sign`/`signMessage` e namespace `ed25519` continuam com semântica Ed25519 e rejeitam `opt_random`.
193
- - Para compatibilidade com `curve25519-js` (incluindo `opt_random`), use o namespace `axlsign`.
194
- - Assinaturas Ed25519 continuam determinísticas (comportamento padrão do OpenSSL).
195
- - Os módulos WASM (`axlsign` e `wasm`) são carregados sob demanda na primeira chamada (importar apenas `x25519`/`ed25519` não inicializa WASM).
196
-
197
- ---
198
-
199
- ## Motivação
200
-
201
- O `curve25519-js` é um projeto importante, mas usa aritmética de campo manual em JS (`Float64Array`, estilo TweetNaCl).
202
-
203
- Este pacote foca em Node moderno com primitivas do OpenSSL:
204
-
205
- - caminho de implementação mais seguro
206
- - melhor desempenho em Node >= 20
207
- - API menor e explícita
208
- - tipagem forte com zero dependências de runtime
209
-
210
- Além disso:
211
-
212
- - o namespace `axlsign` via WASM permite migração progressiva de código legado;
213
- - o namespace `wasm` via WASM oferece uma alternativa moderna sem dependência de `node:crypto` no caminho criptográfico.
214
-
215
- ---
216
-
217
- ## Tipos Branded
218
-
219
- - `Bytes32`
220
- - `Bytes64`
221
-
222
- Helpers (validam sem copiar):
223
-
224
- - `asBytes32(u8)`
225
- - `asBytes64(u8)`
226
-
227
- ---
228
-
229
- ## Mapa de RFCs (uso no projeto)
230
-
231
- | RFC | Seções usadas | Uso no projeto | Onde no código |
232
- | --------------------------------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
233
- | RFC 7748 (X25519) | Seção 5 (`The X25519 and X448 Functions`) | Regras de clamping/decoding do escalar e comportamento da função X25519 (zera 3 bits baixos, zera bit mais alto, seta o segundo bit mais alto). | `src/x25519.ts` |
234
- | RFC 7748 (X25519) | Seção 5.2 (`Test Vectors`), Seção 6.1 (`Diffie-Hellman / Curve25519`) | Vetores oficiais para validação de interoperabilidade e corretude. | `test/x25519.test.mjs` |
235
- | RFC 8032 (Ed25519) | Seção 5.1.5 (`Key Generation`), 5.1.6 (`Sign`), 5.1.7 (`Verify`) | Semântica de keygen/sign/verify Ed25519 (executada por OpenSSL via `node:crypto`). | `src/ed25519.ts` |
236
- | RFC 8032 (Ed25519) | Seção 7.1 (`Test Vectors for Ed25519`) | Vetores determinísticos para validação de chave pública e assinatura. | `test/ed25519.test.mjs` |
237
- | RFC 8410 (X25519/Ed25519 em PKIX) | Seção 3 (identificadores de algoritmo), Seção 4 (`Subject Public Key Fields`), Seção 7 (`Private Key Format`) | Estrutura DER para import/export de chaves raw de 32 bytes em SPKI/PKCS#8 com OIDs de X25519 e Ed25519. | `src/internal/der.ts` |
238
-
239
- Referências indiretas por estrutura ASN.1/PKIX:
240
-
241
- - RFC 5958 (OneAsymmetricKey / família PKCS#8)
242
- - RFC 5280, Seção 4.1.2.7 (`Subject Public Key Info`)
243
-
244
- Observações:
245
-
246
- - O projeto não reimplementa aritmética de curva em JS; as operações criptográficas usam OpenSSL via `node:crypto`.
247
- - A suíte de testes cobre vetores oficiais do RFC 7748 e RFC 8032.
248
-
249
- Rodar testes:
250
-
251
- ```bash
252
- npm test
253
- ```
254
-
255
- ---
256
-
257
- ## Detalhes Técnicos (DER / RFC 8410)
258
-
259
- Chaves raw de 32 bytes são importadas/exportadas com prefixos fixos:
260
-
261
- - X25519 PKCS#8: `302e020100300506032b656e04220420`
262
- - X25519 SPKI: `302a300506032b656e032100`
263
- - Ed25519 PKCS#8: `302e020100300506032b657004220420`
264
- - Ed25519 SPKI: `302a300506032b6570032100`
265
-
266
- Notas de implementação:
267
-
268
- - buffers prealocados + `.set`
269
- - views zero-copy de `Uint8Array` quando seguro
270
- - sem `Buffer.concat` em hot path
271
-
272
- ---
273
-
274
- ## Notas de Performance
275
-
276
- - Evita cópias desnecessárias de bytes nos caminhos críticos.
277
- - `signMessage` monta `assinatura || mensagem` com um único `Uint8Array` prealocado.
278
- - Para throughput máximo em loops longos, use os helpers de `KeyObject` (`create*KeyObject`, `*FromKeyObjects`) para reduzir overhead de parse ASN.1.
279
-
280
- ---
281
-
282
- ## Notas de Segurança
283
-
284
- - validação estrita de tipo/tamanho nas APIs públicas
285
- - sem log de segredos
286
- - `timingSafeEqual` em comparações internas de tamanho fixo quando necessário
287
-
288
- ---
289
-
290
- ## Benchmarks
291
-
292
- A suíte de benchmark fica isolada em `bench/` (subprojeto separado) e compara com `curve25519-js`.
293
-
294
- ```bash
295
- npm run build
296
- cd bench
297
- npm install
298
- npm run bench
299
- ```
300
-
301
- ### Snapshot real de benchmark (`npm run bench:ci`) no GitHub Codespaces
302
-
303
- Comando:
304
-
305
- ```bash
306
- node --expose-gc bench.mjs --rounds=16 --roundMs=350 --warmupMs=500 --vectors=64 --variants=raw,cached --strict --verifyEvery=64 --jsonFile=results/bench-results.json
307
- ```
308
-
309
- Ambiente:
310
-
311
- - Node: `v24.11.1`
312
- - OpenSSL: `3.5.4`
313
- - CPU: `AMD EPYC 7763 64-Core Processor`
314
- - Cores lógicos: `4`
315
- - Vetores: `64`
316
-
317
- ### Tabela 1 - API moderna (nativa + WASM)
318
-
319
- `sign`/`verify` abaixo comparam throughput de API, não equivalência criptográfica (Ed25519 vs axlsign legado).
320
-
321
- | Operação | Moderno raw | Legado raw (`curve25519-js`) | Speedup raw | Moderno cached | Legado cached (`curve25519-js`) | Speedup cached |
322
- | ----------------------------------- | ----------: | ---------------------------: | ----------: | -------------: | ------------------------------: | -------------: |
323
- | `x25519.generateKeyPair` | 14,082 | 1,579 | 8.92x | 49,035 | 1,576 | 31.12x |
324
- | `x25519.sharedKey` | 10,134 | 1,568 | 6.46x | 25,423 | 1,578 | 16.11x |
325
- | `wasm.x25519.generateKeyPair` | 8,415 | 1,571 | 5.36x | 8,385 | 1,574 | 5.33x |
326
- | `wasm.x25519.sharedKey` | 8,333 | 1,577 | 5.28x | 8,350 | 1,583 | 5.28x |
327
- | `ed25519.sign (msg32)` | 11,273 | 142 | 79.56x | 23,886 | 137 | 174.75x |
328
- | `wasm.ed25519.sign (msg32)` | 3,945 | 142 | 27.80x | 3,956 | 140 | 28.27x |
329
- | `ed25519.sign (msg1024)` | 10,759 | 136 | 79.31x | 22,335 | 138 | 162.38x |
330
- | `wasm.ed25519.sign (msg1024)` | 3,872 | 137 | 28.27x | 3,873 | 137 | 28.37x |
331
- | `ed25519.verify (msg32)` | 7,333 | 142 | 51.65x | 8,186 | 141 | 58.01x |
332
- | `wasm.ed25519.verify (msg32)` | 7,747 | 141 | 54.84x | 7,629 | 143 | 53.26x |
333
- | `ed25519.verify (msg1024)` | 7,241 | 134 | 54.20x | 8,081 | 136 | 59.35x |
334
- | `wasm.ed25519.verify (msg1024)` | 7,505 | 135 | 55.76x | 7,480 | 134 | 55.66x |
335
- | `ed25519.signMessage (msg256)` | 10,859 | 140 | 77.67x | 23,607 | 132 | 178.57x |
336
- | `wasm.ed25519.signMessage (msg256)` | 3,888 | 139 | 27.99x | 3,867 | 137 | 28.23x |
337
- | `ed25519.openMessage (msg256)` | 7,113 | 145 | 49.03x | 8,012 | 141 | 56.96x |
338
- | `wasm.ed25519.openMessage (msg256)` | 7,428 | 137 | 54.26x | 7,476 | 137 | 54.74x |
339
-
340
- ### Tabela 2 - Compatibilidade `axlsign` (equivalente ao `curve25519-js`)
341
-
342
- Aqui a comparação é de mesmo esquema criptográfico (equivalência + throughput).
343
-
344
- | Operação | Moderno raw | Legado raw (`curve25519-js`) | Speedup raw | Moderno cached | Legado cached (`curve25519-js`) | Speedup cached |
345
- | ----------------------------------------- | ----------: | ---------------------------: | ----------: | -------------: | ------------------------------: | -------------: |
346
- | `axlsign.generateKeyPair` | 8,382 | 1,571 | 5.34x | 8,357 | 1,579 | 5.29x |
347
- | `axlsign.sharedKey` | 8,361 | 1,583 | 5.28x | 8,422 | 1,564 | 5.39x |
348
- | `axlsign.sign (msg32)` | 4,010 | 140 | 28.59x | 3,970 | 141 | 28.10x |
349
- | `axlsign.sign (msg32,opt_random)` | 4,000 | 142 | 28.07x | 3,965 | 136 | 29.08x |
350
- | `axlsign.sign (msg1024)` | 3,883 | 138 | 28.17x | 3,878 | 138 | 28.03x |
351
- | `axlsign.verify (msg32)` | 6,604 | 144 | 45.83x | 6,585 | 143 | 46.17x |
352
- | `axlsign.verify (msg32,opt_random)` | 6,531 | 143 | 45.69x | 6,527 | 142 | 46.08x |
353
- | `axlsign.verify (msg1024)` | 6,428 | 138 | 46.47x | 6,377 | 136 | 46.82x |
354
- | `axlsign.signMessage (msg256)` | 3,913 | 140 | 27.85x | 3,935 | 136 | 28.92x |
355
- | `axlsign.signMessage (msg256,opt_random)` | 3,941 | 139 | 28.39x | 3,878 | 139 | 27.93x |
356
- | `axlsign.openMessage (msg256)` | 6,440 | 138 | 46.78x | 6,407 | 136 | 47.18x |
357
- | `axlsign.openMessage (msg256,opt_random)` | 6,513 | 134 | 48.53x | 6,431 | 133 | 48.19x |
358
-
359
- Notas:
360
-
361
- - `raw` inclui custo fim-a-fim da API.
362
- - `cached` reduz overhead de setup para evidenciar melhor o throughput criptográfico.
363
- - Fonte dos números: saída JSON de `bench:ci` (`results/bench-results.json`).
364
-
365
- ---
366
-
367
- ## Build dos namespaces WASM (`axlsign` e `wasm`)
368
-
369
- No pacote publicado no npm, os artefatos WASM já vêm prontos em `dist/`.
370
-
371
- Para buildar a partir do código-fonte, você precisa:
372
-
373
- - Rust toolchain
374
- - `wasm-pack` instalado
375
-
376
- Com isso, `npm run build` executa:
377
-
378
- 1. `wasm-pack build` (`wasm/axlsign`)
379
- 2. `wasm-pack build` (`wasm/curve25519-wasm`)
380
- 3. `tsc` ESM + CJS
381
- 4. cópia dos artefatos WASM para `dist/internal/axlsign-wasm` e `dist/internal/curve25519-wasm`
382
-
383
- Referência dos crates Rust: [wasm/README.md](./wasm/README.md)
384
-
385
- ---
386
-
387
- ## Contribuição
388
-
389
- - Guia: [CONTRIBUTING.md](./CONTRIBUTING.md)
390
- - Código de conduta: [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
391
- - Segurança: [SECURITY.md](./SECURITY.md)
392
-
393
- Validação local completa:
394
-
395
- ```bash
396
- npm run ci
42
+ const { x25519, ed25519, axlsign } = require("@unknownncat/curve25519-node");
397
43
  ```
398
44
 
399
- Checagens extras de robustez/supply-chain:
400
-
401
- ```bash
402
- npm run audit
403
- npm run audit:prod
404
- npm run release:check
405
- ```
406
-
407
- ---
408
-
409
- ## Licença
410
-
411
- MIT
45
+ ## Exports
412
46
 
413
- Documentos complementares:
47
+ - `x25519`
48
+ - `ed25519`
49
+ - `axlsign`
50
+ - aliases top-level: `sharedKey`, `sharedKeyStrict`, `generateKeyPair`, `sign`, `verify`, `signMessage`, `openMessage`
51
+ - tipos/helpers: `Bytes32`, `Bytes64`, `asBytes32`, `asBytes64`
414
52
 
415
- - [NOTICE.md](./NOTICE.md) (aviso oficial de terceiros)
416
- - [THIRD_PARTY_NOTICE.md](./THIRD_PARTY_NOTICE.md) e [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md) (aliases de compatibilidade)
417
- - [SECURITY.md](./SECURITY.md) (política de segurança e reporte de vulnerabilidades)
53
+ ## Observacoes
418
54
 
419
- ---
55
+ - `sign`/`verify` top-level seguem semantica Ed25519 e rejeitam `opt_random`.
56
+ - Para fluxo legado compativel com `curve25519-js`, use `axlsign.*`.
57
+ - Se voce precisa de WASM no navegador, use `@unknownncat/curve25519-browser`.
420
58
 
421
- ## Créditos
59
+ ## Licenca e avisos
422
60
 
423
- - [curve25519-js](https://github.com/harveyconnor/curve25519-js) (Harvey Connor, Dmitry Chestnykh)
424
- - [TweetNaCl.js](https://tweetnacl.js.org/)
425
- - Trevor Perrin, ideia de assinaturas Curve25519: <https://moderncrypto.org/mail-archive/curves/2014/000205.html>
426
- - [Documentação Node.js `crypto`](https://nodejs.org/api/crypto.html)
427
- - [OpenSSL](https://www.openssl.org/)
428
- - [RustCrypto](https://github.com/RustCrypto)
429
- - [wasm-bindgen](https://github.com/wasm-bindgen/wasm-bindgen)
430
- - [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek)
431
- - [ed25519-dalek](https://github.com/dalek-cryptography/ed25519-dalek)
432
- - [x25519-dalek](https://github.com/dalek-cryptography/x25519-dalek)
433
- - [zeroize](https://github.com/RustCrypto/utils/tree/master/zeroize)
434
- - [RFC 7748](https://www.rfc-editor.org/rfc/rfc7748)
435
- - [RFC 8032](https://www.rfc-editor.org/rfc/rfc8032)
436
- - [RFC 8410](https://www.rfc-editor.org/rfc/rfc8410)
437
- - [RFC 5958](https://www.rfc-editor.org/rfc/rfc5958)
438
- - [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280)
61
+ - [LICENSE](./LICENSE)
62
+ - [NOTICE.md](./NOTICE.md)
63
+ - [THIRD_PARTY_NOTICE.md](./THIRD_PARTY_NOTICE.md)
64
+ - [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)
65
+ - [SECURITY.md](./SECURITY.md)
package/dist/axlsign.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Bytes32, Bytes64, KeyPair32 } from "./types.js";
2
2
  /**
3
- * Derives an axlsign-compatible public key (Montgomery/X25519 format).
3
+ * Derives an axlsign-compatible public key (Montgomery/X25519 format) in Node runtime.
4
4
  */
5
5
  export declare function publicKey(secretKey32: Bytes32): Bytes32;
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"axlsign.d.ts","sourceRoot":"","sources":["../src/axlsign.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4E9D;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAIvD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAK7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAQ1D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAU5F;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAK3F;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,OAAO,EACpB,GAAG,EAAE,UAAU,EACf,UAAU,CAAC,EAAE,UAAU,GACtB,UAAU,CAUZ;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAe1F"}
1
+ {"version":3,"file":"axlsign.d.ts","sourceRoot":"","sources":["../src/axlsign.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAyB9D;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAIvD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAK7E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAQ1D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAU5F;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,GAAG,OAAO,CAK3F;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,OAAO,EACpB,GAAG,EAAE,UAAU,EACf,UAAU,CAAC,EAAE,UAAU,GACtB,UAAU,CAUZ;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAe1F"}
package/dist/axlsign.js CHANGED
@@ -1,48 +1,6 @@
1
- import { existsSync } from "node:fs";
2
- import { dirname, isAbsolute, join } from "node:path";
3
- import { createRequire } from "node:module";
4
1
  import { asBytes32, asBytes64, assertBytes32, assertBytes64, assertUint8Array, } from "./internal/assert.js";
5
- const SELF_PACKAGE_NAME = "@unknownncat/curve25519-node";
6
- const requireBase = typeof __filename === "string"
7
- ? __filename
8
- : typeof process.argv[1] === "string" && isAbsolute(process.argv[1])
9
- ? process.argv[1]
10
- : join(process.cwd(), "package.json");
11
- const nodeRequire = createRequire(requireBase);
12
- let wasmModulePath;
13
- let wasmAxl;
14
- function resolveWasmModulePath() {
15
- const candidates = [];
16
- try {
17
- const packageJsonPath = nodeRequire.resolve(`${SELF_PACKAGE_NAME}/package.json`);
18
- candidates.push(join(dirname(packageJsonPath), "dist", "internal", "axlsign-wasm", "axlsign_wasm.js"));
19
- }
20
- catch {
21
- // Fall back to local development paths below.
22
- }
23
- if (typeof __dirname === "string") {
24
- candidates.push(join(__dirname, "internal", "axlsign-wasm", "axlsign_wasm.js"));
25
- }
26
- candidates.push(join(process.cwd(), "dist", "internal", "axlsign-wasm", "axlsign_wasm.js"));
27
- candidates.push(join(process.cwd(), "src", "internal", "axlsign-wasm", "axlsign_wasm.js"));
28
- for (const candidate of candidates) {
29
- if (existsSync(candidate)) {
30
- return candidate;
31
- }
32
- }
33
- throw new Error("Unable to locate axlsign WASM module. Run `npm run build` before using axlsign in local dev.");
34
- }
35
- function getWasmAxl() {
36
- if (wasmAxl !== undefined) {
37
- return wasmAxl;
38
- }
39
- if (wasmModulePath === undefined) {
40
- wasmModulePath = resolveWasmModulePath();
41
- }
42
- // Lazy-load WASM bindings to keep modern-only imports lightweight.
43
- wasmAxl = nodeRequire(wasmModulePath);
44
- return wasmAxl;
45
- }
2
+ import * as rustAxlsign from "./internal/axlsign-wasm/axlsign_wasm.js";
3
+ const rustBindings = rustAxlsign;
46
4
  function clampScalar(seed32) {
47
5
  const out = new Uint8Array(32);
48
6
  out.set(seed32);
@@ -57,11 +15,11 @@ function assertOptionalRandom64(value, fnName) {
57
15
  assertBytes64(value, `${fnName} opt_random`);
58
16
  }
59
17
  /**
60
- * Derives an axlsign-compatible public key (Montgomery/X25519 format).
18
+ * Derives an axlsign-compatible public key (Montgomery/X25519 format) in Node runtime.
61
19
  */
62
20
  export function publicKey(secretKey32) {
63
21
  assertBytes32(secretKey32, "secretKey32");
64
- const out = getWasmAxl().axlsignPublicKey(secretKey32);
22
+ const out = rustBindings.axlsignPublicKey(secretKey32);
65
23
  return asBytes32(out, "axlsign public key");
66
24
  }
67
25
  /**
@@ -70,7 +28,7 @@ export function publicKey(secretKey32) {
70
28
  export function sharedKey(secretKey32, publicKey32) {
71
29
  assertBytes32(secretKey32, "secretKey32");
72
30
  assertBytes32(publicKey32, "publicKey32");
73
- const out = getWasmAxl().axlsignSharedKey(secretKey32, publicKey32);
31
+ const out = rustBindings.axlsignSharedKey(secretKey32, publicKey32);
74
32
  return asBytes32(out, "axlsign shared key");
75
33
  }
76
34
  /**
@@ -94,8 +52,8 @@ export function sign(secretKey32, msg, opt_random) {
94
52
  assertUint8Array(msg, "msg");
95
53
  assertOptionalRandom64(opt_random, "sign");
96
54
  const signature = opt_random === undefined
97
- ? getWasmAxl().axlsignSign(secretKey32, msg)
98
- : getWasmAxl().axlsignSignRnd(secretKey32, msg, opt_random);
55
+ ? rustBindings.axlsignSign(secretKey32, msg)
56
+ : rustBindings.axlsignSignRnd(secretKey32, msg, opt_random);
99
57
  return asBytes64(signature, "axlsign signature");
100
58
  }
101
59
  /**
@@ -105,7 +63,7 @@ export function verify(publicKey32, msg, signature64) {
105
63
  assertBytes32(publicKey32, "publicKey32");
106
64
  assertUint8Array(msg, "msg");
107
65
  assertBytes64(signature64, "signature64");
108
- return getWasmAxl().axlsignVerify(publicKey32, msg, signature64);
66
+ return rustBindings.axlsignVerify(publicKey32, msg, signature64);
109
67
  }
110
68
  /**
111
69
  * Returns signature || message (axlsign mode).
@@ -1 +1 @@
1
- {"version":3,"file":"axlsign.js","sourceRoot":"","sources":["../src/axlsign.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AAEzD,MAAM,WAAW,GACf,OAAO,UAAU,KAAK,QAAQ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