@unknownncat/curve25519-node 1.0.0 → 1.0.1
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/README.md +22 -7
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# @unknownncat/curve25519-node
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@unknownncat/curve25519-node)
|
|
4
|
+
[](https://www.npmjs.com/package/@unknownncat/curve25519-node)
|
|
5
5
|
[](./dist/index.d.ts)
|
|
6
|
-
[](./LICENSE)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
8
|

|
|
9
9
|

|
|
@@ -19,7 +19,7 @@ Modern **zero-dependency** X25519 + Ed25519 for Node.js using OpenSSL via `node:
|
|
|
19
19
|
|
|
20
20
|
## Why
|
|
21
21
|
|
|
22
|
-
O projeto original ([curve25519-js](https://github.com/harveyconnor/curve25519-js))
|
|
22
|
+
O projeto original ([curve25519-js](https://github.com/harveyconnor/curve25519-js)) faz aritmética de campo manual em `Float64Array` (derivado de TweetNaCl) para Curve25519/Ed25519.
|
|
23
23
|
|
|
24
24
|
Este pacote troca isso por primitivas nativas do OpenSSL (via `node:crypto`), com foco em:
|
|
25
25
|
|
|
@@ -45,6 +45,8 @@ Consequências:
|
|
|
45
45
|
- Conversão X25519 public key ↔ Ed25519 public key **não é exposta** por `node:crypto`.
|
|
46
46
|
- `opt_random` (64 bytes) do legado **não é suportado** em Ed25519 com `node:crypto`.
|
|
47
47
|
- O compat layer aceita um 3º argumento apenas por compatibilidade de chamada, mas **sempre lança erro** se ele for fornecido.
|
|
48
|
+
- As assinaturas Ed25519 aqui são determinísticas (comportamento padrão do OpenSSL para Ed25519).
|
|
49
|
+
- No legado, `openMessage` pode alterar o `signedMsg` recebido (bit de sinal); nesta implementação, as entradas não são modificadas.
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
|
@@ -105,9 +107,9 @@ const sig = ed25519.sign(seed, Buffer.from("hello"));
|
|
|
105
107
|
### Subpath imports (opcional)
|
|
106
108
|
|
|
107
109
|
```ts
|
|
108
|
-
import {
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
110
|
+
import { generateKeyPair as xGenerateKeyPair, sharedKey } from "@unknownncat/curve25519-node/x25519";
|
|
111
|
+
import { sign, verify } from "@unknownncat/curve25519-node/ed25519";
|
|
112
|
+
import type { Bytes32, Bytes64 } from "@unknownncat/curve25519-node/types";
|
|
111
113
|
```
|
|
112
114
|
|
|
113
115
|
---
|
|
@@ -199,6 +201,19 @@ Cobertura inclui vetores RFC:
|
|
|
199
201
|
|
|
200
202
|
---
|
|
201
203
|
|
|
204
|
+
## Benchmarks
|
|
205
|
+
|
|
206
|
+
Há um subprojeto isolado em `bench/` para comparar este pacote com `curve25519-js` sem adicionar dependências ao pacote principal.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
npm run build
|
|
210
|
+
cd bench
|
|
211
|
+
npm install
|
|
212
|
+
npm run bench
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
202
217
|
## License
|
|
203
218
|
|
|
204
219
|
MIT © unknownncat — veja [LICENSE](./LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unknownncat/curve25519-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Modern zero-dependency X25519 + Ed25519 for Node.js using OpenSSL via node:crypto",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"curve25519",
|
|
@@ -67,6 +67,8 @@
|
|
|
67
67
|
"build:cjs": "tsc -p tsconfig.cjs.json && node scripts/write-cjs-package-json.mjs",
|
|
68
68
|
"build": "npm run clean && npm run build:esm && npm run build:cjs",
|
|
69
69
|
"test": "npm run build && node --test \"test/*.test.mjs\"",
|
|
70
|
+
"bench": "npm run build && npm --prefix bench run bench",
|
|
71
|
+
"bench:quick": "npm run build && npm --prefix bench run bench:quick",
|
|
70
72
|
"prepack": "npm run test",
|
|
71
73
|
"prepublishOnly": "npm run test"
|
|
72
74
|
},
|