@shieldfive/crypto 1.0.0-beta.3 → 1.0.0-rc.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +73 -20
  3. package/SECURITY.md +38 -24
  4. package/dist/identity/index.d.ts +1 -1
  5. package/dist/identity/index.d.ts.map +1 -1
  6. package/dist/identity/index.js +1 -1
  7. package/dist/identity/index.js.map +1 -1
  8. package/dist/identity/sign.d.ts +73 -21
  9. package/dist/identity/sign.d.ts.map +1 -1
  10. package/dist/identity/sign.js +105 -35
  11. package/dist/identity/sign.js.map +1 -1
  12. package/dist/index.d.ts +3 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/streams/aes-gcm-v1.d.ts +9 -5
  17. package/dist/streams/aes-gcm-v1.d.ts.map +1 -1
  18. package/dist/streams/aes-gcm-v1.js +26 -24
  19. package/dist/streams/aes-gcm-v1.js.map +1 -1
  20. package/dist/streams/pq-hybrid-v1.d.ts +4 -3
  21. package/dist/streams/pq-hybrid-v1.d.ts.map +1 -1
  22. package/dist/streams/pq-hybrid-v1.js +20 -18
  23. package/dist/streams/pq-hybrid-v1.js.map +1 -1
  24. package/dist/suites/aes-gcm-v0/api.d.ts +2 -1
  25. package/dist/suites/aes-gcm-v0/api.d.ts.map +1 -1
  26. package/dist/suites/aes-gcm-v0/api.js +1 -0
  27. package/dist/suites/aes-gcm-v0/api.js.map +1 -1
  28. package/dist/suites/aes-gcm-v1/api.d.ts +15 -2
  29. package/dist/suites/aes-gcm-v1/api.d.ts.map +1 -1
  30. package/dist/suites/aes-gcm-v1/api.js.map +1 -1
  31. package/dist/suites/aes-gcm-v2/api.d.ts +15 -2
  32. package/dist/suites/aes-gcm-v2/api.d.ts.map +1 -1
  33. package/dist/suites/aes-gcm-v2/api.js.map +1 -1
  34. package/dist/suites/pq-hybrid-v1/api.d.ts +6 -6
  35. package/dist/suites/pq-hybrid-v1/api.d.ts.map +1 -1
  36. package/dist/suites/pq-hybrid-v1/api.js +2 -1
  37. package/dist/suites/pq-hybrid-v1/api.js.map +1 -1
  38. package/dist/suites/pq-hybrid-v1/index.d.ts.map +1 -1
  39. package/dist/suites/pq-hybrid-v1/index.js +11 -4
  40. package/dist/suites/pq-hybrid-v1/index.js.map +1 -1
  41. package/dist/suites/xchacha-v1/api.d.ts +15 -6
  42. package/dist/suites/xchacha-v1/api.d.ts.map +1 -1
  43. package/dist/suites/xchacha-v1/api.js +2 -1
  44. package/dist/suites/xchacha-v1/api.js.map +1 -1
  45. package/package.json +2 -1
  46. package/spec/format-v1.md +59 -17
  47. package/spec/key-derivation.md +9 -2
  48. package/spec/threat-model.md +8 -2
  49. package/src/identity/index.ts +3 -2
  50. package/src/identity/sign.ts +118 -40
  51. package/src/index.ts +3 -3
  52. package/src/streams/aes-gcm-v1.ts +37 -30
  53. package/src/streams/pq-hybrid-v1.ts +29 -21
  54. package/src/suites/aes-gcm-v0/api.ts +2 -1
  55. package/src/suites/aes-gcm-v1/api.ts +15 -2
  56. package/src/suites/aes-gcm-v2/api.ts +15 -2
  57. package/src/suites/pq-hybrid-v1/api.ts +10 -8
  58. package/src/suites/pq-hybrid-v1/index.ts +14 -8
  59. package/src/suites/xchacha-v1/api.ts +19 -8
package/CHANGELOG.md CHANGED
@@ -5,6 +5,99 @@ All notable changes to `@shieldfive/crypto` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 1.0.0-rc.1 — 2026-07-14
9
+
10
+ Release candidate for `1.0.0`. The v1 wire format and the public TypeScript API
11
+ are frozen; `1.0.0` follows once the RC has soaked. Not externally audited (see
12
+ README "Status"); an internal multi-agent review shipped and its findings are
13
+ fixed. No wire-format changes — every file written by a `1.0.0-*` release
14
+ decrypts identically.
15
+
16
+ ### Added
17
+
18
+ - Published **negative / adversarial test vectors**
19
+ (`tests/vectors/adversarial-vectors.json`): tampered v1 files that a conforming
20
+ decoder MUST reject — bad magic, unknown/confused suite, reserved flags,
21
+ header-field and header-MAC tampering, chunk ciphertext/tag/framing tampering,
22
+ reordering, truncation, and cross-file splice — across all four suites, each
23
+ with a valid control. Generated and self-checked by
24
+ `tests/vectors/generate-adversarial.ts` and enforced by
25
+ `tests/vectors/adversarial-vectors.test.ts`. Companion to the existing positive
26
+ known-answer vectors; lets independent implementations verify the format's
27
+ misuse-resistance guarantees, not just its happy path.
28
+
29
+ ### Changed (non-breaking API consistency)
30
+
31
+ - Suite option types now use one convention: `xchacha-v1` and `pq-hybrid-v1`
32
+ export `EncryptOptions` / `DecryptOptions` (previously `XChaCha*` / `PqHybrid*`
33
+ prefixed), matching `aes-gcm-v1` / `aes-gcm-v2`. No consumer referenced the old
34
+ prefixed type names.
35
+ - `encryptBytes` now accepts `Uint8Array | ArrayBuffer` in every suite
36
+ (previously `xchacha-v1` / `pq-hybrid-v1` accepted only `Uint8Array`).
37
+ Widening only — existing calls are unaffected.
38
+ - Progress callbacks use the exported `ProgressCallback` type consistently
39
+ across `autoDecryptBlob` and the legacy-v0 reader (type-identical).
40
+
41
+ The public umbrella surface — including `parseHeader`, the header builders,
42
+ `identity`, and `migrationV0` — is intentionally unchanged; those remain stable
43
+ top-level exports that downstream consumers depend on.
44
+
45
+ ## 1.0.0-beta.4 — 2026-07-13
46
+
47
+ ### Security
48
+
49
+ - **Sender-attribution signatures now commit to ciphertext content, not just
50
+ AEAD tags.** The optional Ed25519 signature block previously signed
51
+ `header_unauthenticated_bytes || concat(per-chunk AEAD tags)`. Because an
52
+ AEAD tag (GHASH / Poly1305) is forgeable by a holder of the content key, a
53
+ recipient/collaborator could rewrite chunk ciphertext while keeping every
54
+ tag byte-identical, so `decrypt` returned attacker-modified plaintext while
55
+ `metadata.signature.verified` stayed `true` — a sender-attribution bypass
56
+ affecting both the `aes-256-gcm-v1` and `pq-hybrid-xchacha-mlkem1024-v1`
57
+ stream suites. Reported via the bug bounty program (Mudit Raj). The signed
58
+ message is now the SHA-256 digest of a domain-separated, length-framed
59
+ transcript over the header and **every chunk's full ciphertext** (see
60
+ `spec/format-v1.md § "Signature block"`), hashed incrementally so signing
61
+ stays O(1) in memory. `verified: true` now means the signer signed exactly
62
+ the ciphertext presented.
63
+
64
+ **Breaking (signature profile only):** this redefines what algorithm `0x01`
65
+ signs. Signatures produced by earlier versions no longer verify (they are
66
+ reported `verified: false`, fail-closed). Unsigned/legacy files are
67
+ unaffected and decrypt unchanged (`signature: null`); confidentiality,
68
+ `header_mac`, and per-chunk AEAD integrity are unchanged. The signing
69
+ feature was optional and unused by any production deployment, so no
70
+ interoperable signed files exist under the old transcript.
71
+
72
+ ### Changed
73
+
74
+ - `src/identity/sign.ts`: removed `signHeaderAndMacs` / `verifyHeaderAndMacs`
75
+ (which signed the tag-only transcript); added `SenderSigTranscript`,
76
+ `signSenderTranscript`, and `verifySenderTranscript`. New direct dependency
77
+ on `@noble/hashes` for the incremental SHA-256 transcript.
78
+ - `src/suites/pq-hybrid-v1/index.ts`: `decapsulateFromHeader` now folds a
79
+ failed classical unwrap into a single generic `decapsulate: unwrap failed`
80
+ error (catching the libsodium secretbox throw) and removes a previously
81
+ unreachable `if (!classicalShare)` guard. No behavior change on the happy
82
+ path. Hardening from a coordinated-disclosure report noting the throw-vs-no-
83
+ throw distinguishability between a wrong `envelopeKey` and a bad ML-KEM
84
+ ciphertext; not a reachable oracle in any shipped path (share recipients
85
+ take the `combinedKey` branch and bypass this function, and `envelopeKey`
86
+ is the owner's own client-side key).
87
+
88
+ ### Documentation
89
+
90
+ - `spec/threat-model.md` and `spec/key-derivation.md`: corrected the claim
91
+ that the crypto layer "enforces fresh per-file content keys." The library
92
+ **defaults** to fresh `content_key`/`file_id` per file but cannot enforce
93
+ uniqueness when a caller supplies both overrides; pair-uniqueness across
94
+ distinct plaintexts is a caller obligation, documented as such. Added a
95
+ SECURITY note to the `contentKey`/`fileId` override params in the
96
+ `aes-gcm-v1` and `xchacha-v1` encrypt options. From a coordinated-disclosure
97
+ report on AEAD nonce reuse under caller-supplied key reuse (not reachable on
98
+ the default path or in the shipped application, which always uses fresh
99
+ material per file).
100
+
8
101
  ## 1.0.0-beta.3 — 2026-07-02
9
102
 
10
103
  > Re-release of `1.0.0-beta.2` through the tag-triggered CI pipeline so the
package/README.md CHANGED
@@ -4,24 +4,38 @@
4
4
  > cipher-suite-agile on-disk format. The cryptographic core of
5
5
  > [ShieldFive](https://shieldfive.com), released as a standalone library.
6
6
 
7
+ [![npm](https://img.shields.io/npm/v/@shieldfive/crypto?logo=npm&color=cb3837)](https://www.npmjs.com/package/@shieldfive/crypto)
7
8
  [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
8
- [![Tests](https://img.shields.io/badge/tests-188%2F188-brightgreen.svg)](tests/)
9
- [![Status](https://img.shields.io/badge/status-beta-yellow.svg)](#status)
9
+ [![Tests](https://img.shields.io/badge/tests-259%2F259-brightgreen.svg)](tests/)
10
+ [![npm provenance](https://img.shields.io/badge/npm-provenance-blue?logo=npm)](https://www.npmjs.com/package/@shieldfive/crypto)
11
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/shieldfive/crypto/badge)](https://securityscorecards.dev/viewer/?uri=github.com/shieldfive/crypto)
12
+ [![Status](https://img.shields.io/badge/status-1.0.0--rc.1-blue.svg)](#status)
13
+ <!-- Once registered at https://www.bestpractices.dev, add the earned badge:
14
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/<ID>/badge)](https://www.bestpractices.dev/projects/<ID>) -->
15
+
10
16
 
11
17
  ## Status & honest scope
12
18
 
13
- This library is **beta**. The wire format is frozen for the v1 release;
14
- the public TypeScript API may make minor adjustments before v1.0.0 stable.
15
- It has **not** undergone external cryptographic audit. Until it does,
16
- treat this library as a serious work-in-progress rather than a finished
17
- product.
19
+ This library is a **release candidate** (`1.0.0-rc.1`). The v1 **wire format
20
+ is frozen** — files written today will decrypt on every future v1 release —
21
+ and the public TypeScript API is now stable; `1.0.0` follows once the RC has
22
+ soaked. `1.0.0` means the API is stable under semantic versioning, **not**
23
+ that the code has been audited. Those are two separate axes and we track them
24
+ separately (see [Status](#status)).
25
+
26
+ **Audit status:** this library has **not** received a paid third-party
27
+ cryptographic audit, and `1.0.0` will not claim one. It has had an internal
28
+ multi-agent review (findings fixed) and publishes reproducible positive and
29
+ adversarial test vectors; an external audit is on the roadmap (we are pursuing
30
+ grant-funded options). [Status](#status) states exactly what has and has not
31
+ been reviewed, and what you can verify yourself without trusting us.
18
32
 
19
33
  The design choices documented in [`spec/`](spec/) are deliberate and
20
- reviewable. The implementation is covered by 188 passing tests including
34
+ reviewable. The implementation is covered by 259 passing tests including
21
35
  truncation, reordering, splice, and tampering detection across all four
22
- suites. That is enough for internal dogfooding. It is **not** enough to
23
- claim "most secure crypto library" — that claim requires external review
24
- this library has not yet received.
36
+ suites. That is enough for internal dogfooding and for building on with
37
+ eyes open. It is **not** enough to claim "most secure crypto library" —
38
+ that claim requires external review this library has not yet received.
25
39
 
26
40
  When this library says it avoids a parallel cryptographic implementation,
27
41
  that scope is the file-content cipher suites. The keyring/envelope layer
@@ -99,8 +113,12 @@ const plaintext = await decryptBlob({
99
113
 
100
114
  ### Encrypt with the WebCrypto-only suite (no WASM dependency)
101
115
 
116
+ Use `aes-gcm-v2` — the current AES-GCM **write** path (also WASM-free). The
117
+ `aes-gcm-v1` subpath is decrypt-only for files written before `v2` existed;
118
+ don't write new files with it.
119
+
102
120
  ```ts
103
- import { encryptBlob, decryptBlob } from '@shieldfive/crypto/aes-gcm-v1'
121
+ import { encryptBlob, decryptBlob } from '@shieldfive/crypto/aes-gcm-v2'
104
122
 
105
123
  const result = await encryptBlob({ blob: file })
106
124
  // result.contentKey is your 32-byte fresh per-file key — store it wrapped
@@ -251,12 +269,46 @@ Requires Node 20+.
251
269
 
252
270
  ## Status
253
271
 
254
- **Beta.** The wire format is frozen for the v1 release, but the public
255
- TypeScript API may make small adjustments before 1.0.0 stable. Test
256
- coverage is comprehensive (188 tests, all four suites, all architectural
257
- guarantees verified). A formal third-party security audit is planned for
258
- the 1.0.0 stable milestone — until that audit lands, treat this library
259
- as a serious work-in-progress rather than a finished product.
272
+ **Release candidate (`1.0.0-rc.1`) — API frozen, format frozen.** This
273
+ section tracks two independent axes; please don't conflate them.
274
+
275
+ **API stability.** The v1 wire format is frozen — files written today
276
+ decrypt on every future v1 release. The public TypeScript API is frozen for
277
+ `1.0.0`; breaking changes will require a major-version bump. `1.0.0` means
278
+ the API is stable under semantic versioning. It does **not** mean "audited."
279
+
280
+ **Audit status (scoped to `v1.0.0-rc.1`).** `@shieldfive/crypto` has
281
+ **not** had a paid third-party security audit. The novel part of the
282
+ design — the post-quantum-hybrid KEM combiner
283
+ `K = HKDF-SHA-256(classical_share ‖ ml_kem_share, salt = file_id)`
284
+ (see [`spec/key-derivation.md`](spec/key-derivation.md)) — uses the same
285
+ concatenation-KDF hybrid pattern as X-Wing and HPKE, but has not yet
286
+ received external cryptographic review. An external audit is on the
287
+ roadmap (grant-funded options are being pursued) and is **not** a
288
+ prerequisite for the `1.0.0` release. When an audit lands it will be cited here
289
+ with the firm, the date, and the exact commit/version reviewed — and this
290
+ notice stays in place for any version that predates that review.
291
+
292
+ **What you can verify without trusting us:**
293
+
294
+ ```bash
295
+ npm audit signatures # npm provenance: tarball ↔ this source commit + CI run
296
+ npm test # 259 tests incl. deterministic KATs + adversarial vectors
297
+ ```
298
+
299
+ The [`tests/vectors/`](tests/vectors/) directory publishes reproducible vectors
300
+ any independent implementation can check against: **positive** known-answer
301
+ vectors ([`vectors.json`](tests/vectors/vectors.json)) that a conforming
302
+ implementation must reproduce bit-for-bit, and **negative / adversarial** vectors
303
+ ([`adversarial-vectors.json`](tests/vectors/adversarial-vectors.json)) — tampered
304
+ files a conforming decoder MUST reject (bad magic, suite confusion, header/chunk
305
+ tampering, reordering, truncation, cross-file splice), each self-checked against
306
+ this implementation at generation time.
307
+
308
+ Plus a published [threat model](spec/threat-model.md) with explicit
309
+ non-goals, a complete [wire-format spec](spec/format-v1.md), and
310
+ reproducible [test vectors](tests/vectors/vectors.json) any independent
311
+ implementation can check against.
260
312
 
261
313
  ## License
262
314
 
@@ -283,8 +335,9 @@ in good faith are protected under the safe-harbor clause.
283
335
  audited by an external firm. ShieldFive's PQ-hybrid construction on
284
336
  top of the library — the HKDF-SHA-256 combiner that mixes the
285
337
  classical and ML-KEM shares — has also not received an independent
286
- external audit. A third-party audit of the ShieldFive layer is
287
- planned for the v1.0.0 stable milestone.
338
+ external audit. A third-party audit of the ShieldFive layer is on the
339
+ roadmap (see [Status](#status)); it is tracked separately from, and is
340
+ not a prerequisite for, the `1.0.0` API-stability milestone.
288
341
  - [libsodium](https://github.com/jedisct1/libsodium) — XChaCha20-Poly1305
289
342
  and XSalsa20-Poly1305 secretbox.
290
343
  - The NIST PQC competition and FIPS 203 authors.
package/SECURITY.md CHANGED
@@ -31,12 +31,24 @@ follow up over an encrypted channel.
31
31
 
32
32
  ## Our commitments
33
33
 
34
- | Severity | Acknowledgement | Initial response | Patch target |
35
- | ----------------------------- | :-------------: | :--------------: | :----------: |
36
- | Critical (key recovery, RCE) | 24 hours | 48 hours | 7 days |
37
- | High (integrity bypass) | 48 hours | 5 days | 14 days |
38
- | Medium (DoS, info leakage) | 72 hours | 7 days | 30 days |
39
- | Low (defense-in-depth) | 7 days | 14 days | 90 days |
34
+ These windows reflect the realistic capacity of a small team, not
35
+ aspiration; we will explain any slippage in writing.
36
+
37
+ | Step | Commitment |
38
+ | --------------------- | --------------- |
39
+ | Acknowledge receipt | within 72 hours |
40
+ | Initial triage reply | within 7 days |
41
+ | Critical patch target | 14 days |
42
+ | High patch target | 30 days |
43
+ | Medium patch target | 90 days |
44
+ | Low / informational | best effort |
45
+
46
+ Severity is assigned by the impact described in
47
+ [`spec/threat-model.md`](spec/threat-model.md): Critical = plaintext or
48
+ key recovery, or RCE; High = integrity bypass that returns mutated
49
+ plaintext as if authentic; Medium = exploitable implementation error or
50
+ spec-vs-implementation drift with security implications; Low =
51
+ defense-in-depth. We explain our severity assignment in every reply.
40
52
 
41
53
  We will:
42
54
 
@@ -52,7 +64,7 @@ We will *not*:
52
64
 
53
65
  - Take legal action against researchers acting in good faith (see
54
66
  Safe Harbor below).
55
- - Demand silence as a condition of bounty or credit.
67
+ - Demand silence as a condition of credit.
56
68
 
57
69
  ## Safe Harbor
58
70
 
@@ -75,21 +87,14 @@ and we will not initiate legal action against you. If a third party
75
87
  initiates legal action against you for activities conducted under this
76
88
  policy, we will make this authorization clear.
77
89
 
78
- ## Bug bounty
90
+ ## Recognition
79
91
 
80
- ShieldFive operates a paid bug bounty program covering this
81
- open-source crypto library. Reward tiers:
82
-
83
- - Critical: up to €1000
84
- - High: up to €500
85
- - Medium: up to €250
86
-
87
- Lower-impact findings receive public credit (CVE, release notes,
88
- dedicated thank-you page) and product credits.
89
-
90
- For current scope, rules of engagement, submission instructions,
91
- and the safe-harbor statement, see
92
- https://shieldfive.com/security/bug-bounty.
92
+ `@shieldfive/crypto` does **not** currently operate a paid bug-bounty
93
+ program. We still want to hear about vulnerabilities, and we recognize
94
+ valid reports with public credit — a CVE where appropriate, attribution in
95
+ the release notes, and a place in the acknowledgements below — with your
96
+ consent, or anonymously if you prefer. Coordinated disclosure and the
97
+ safe-harbor terms above apply to every report.
93
98
 
94
99
  ## Out of scope
95
100
 
@@ -122,9 +127,18 @@ holding, please cite the specific paragraph.
122
127
 
123
128
  ## Acknowledgements
124
129
 
125
- (This list will be populated as reports come in. Researchers are credited
126
- with their consent.)
130
+ With thanks to the researchers who have reported findings in good faith
131
+ (listed with their consent):
132
+
133
+ - **Mudit Raj** — the optional v1 sender-attribution signature committed
134
+ only to the per-chunk AEAD tags, not the ciphertext, letting a content-key
135
+ holder rewrite chunk ciphertext while `signature.verified` stayed `true`
136
+ (a sender-attribution bypass affecting both stream suites; High). Fixed by
137
+ signing a ciphertext-committing SHA-256 transcript (see CHANGELOG).
138
+ - **0xEr3n** ([x.com/0xEr3n](https://x.com/0xEr3n)) — reader-validation
139
+ consistency hardening in the Suite 0x03 combined-key stream decrypt
140
+ path (Low / defense-in-depth; fixed in 1.0.0-beta.3).
127
141
 
128
142
  ---
129
143
 
130
- Last updated: v1.0.0-beta.3
144
+ Last updated: 2026-07-14
@@ -17,7 +17,7 @@
17
17
  * want stronger identity (e.g. SAS verification, gossiped signatures),
18
18
  * they wrap this module rather than modify it.
19
19
  */
20
- export { SIGNATURE_ALGO_ED25519, SIGNATURE_ALGO_ML_DSA_65, ED25519_PUBLIC_KEY_LENGTH, ED25519_SECRET_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, SignatureError, buildSignatureBlock, deriveEd25519PublicKey, parseSignatureBlock, signHeaderAndMacs, verifyHeaderAndMacs, } from './sign.js';
20
+ export { SIGNATURE_ALGO_ED25519, SIGNATURE_ALGO_ML_DSA_65, ED25519_PUBLIC_KEY_LENGTH, ED25519_SECRET_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, SignatureError, buildSignatureBlock, deriveEd25519PublicKey, parseSignatureBlock, SenderSigTranscript, signSenderTranscript, verifySenderTranscript, } from './sign.js';
21
21
  export type { SignatureBlock } from './sign.js';
22
22
  export interface PublicIdentityBundle {
23
23
  /** ML-KEM-1024 public key (1568 bytes) */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,WAAW,CAAA;AAClB,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA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eypair, encapsulateForRecipient, decapsulateFromHeader, parsePqHybridV1SuitePayload, } from '../suites/pq-hybrid-v1/index.js';
21
- export { SIGNATURE_ALGO_ED25519, SIGNATURE_ALGO_ML_DSA_65, ED25519_PUBLIC_KEY_LENGTH, ED25519_SECRET_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, SignatureError, buildSignatureBlock, deriveEd25519PublicKey, parseSignatureBlock, signHeaderAndMacs, verifyHeaderAndMacs, } from './sign.js';
21
+ export { SIGNATURE_ALGO_ED25519, SIGNATURE_ALGO_ML_DSA_65, ED25519_PUBLIC_KEY_LENGTH, ED25519_SECRET_KEY_LENGTH, ED25519_SIGNATURE_LENGTH, SignatureError, buildSignatureBlock, deriveEd25519PublicKey, parseSignatureBlock, SenderSigTranscript, signSenderTranscript, verifySenderTranscript, } from './sign.js';
22
22
  import { bytesToBase64, base64ToBytes, concatBytes, uint16BE, uint32BE, readUint16BE, readUint32BE, } from '../internal/encoding.js';
23
23
  import { randomBytes } from '../internal/runtime.js';
24
24
  import { getSodium } from '../internal/sodium.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,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S,CAAC,CAAA;AAClC,CAAC"}
@@ -3,14 +3,28 @@
3
3
  *
4
4
  * The v1 file format already authenticates with HMAC under the content
5
5
  * key (`header_mac`) and per-chunk AEAD tags, so a recipient can be sure
6
- * the file decrypts to bytes the encryptor produced. What it does NOT
7
- * tell them is WHO encrypted it — anyone with the content key could have
8
- * written the file.
6
+ * the file decrypts to bytes *some* content-key holder produced. What it
7
+ * does NOT tell them is WHO produced it — anyone with the content key
8
+ * could have written the file.
9
9
  *
10
- * This module adds an optional detached signature over
11
- * `header_unauthenticated_bytes || concat(per-chunk MAC tags)` so that a
10
+ * This module adds an optional detached Ed25519 signature so that a
12
11
  * recipient who trusts a sender's public key can verify authorship. The
13
- * signature lives in an optional trailing structure (see
12
+ * signed message is a domain-separated, length-framed SHA-256 transcript
13
+ * that commits to the header AND every chunk's full ciphertext (body +
14
+ * AEAD tag) — see {@link SenderSigTranscript}.
15
+ *
16
+ * It deliberately does NOT sign the AEAD tags alone. An AEAD tag (GHASH
17
+ * for AES-GCM, Poly1305 for the PQ suite) is a keyed polynomial MAC that
18
+ * a *content-key holder* can forge: knowing the key, they can rewrite
19
+ * chunk ciphertext while holding the 16-byte tag byte-identical. Since
20
+ * the entire point of attribution is to bind content against exactly such
21
+ * a holder (an outsider without the content key cannot decrypt at all),
22
+ * the signature must commit to the ciphertext bytes themselves, not to a
23
+ * value the holder can keep fixed under a chosen-plaintext change. The
24
+ * transcript is hashed incrementally, so signing/verifying stays O(1) in
25
+ * memory for multi-gigabyte streams.
26
+ *
27
+ * The signature lives in an optional trailing structure (see
14
28
  * `spec/format-v1.md § "Signature block"`); legacy files without that
15
29
  * structure continue to decrypt unchanged, with the receiving side
16
30
  * reporting `signature: null`.
@@ -39,34 +53,72 @@ export declare class SignatureError extends Error {
39
53
  constructor(code: string);
40
54
  }
41
55
  /**
42
- * Produce a detached Ed25519 signature over
43
- * `header_unauthenticated_bytes || concat(chunk_macs)`.
56
+ * Incremental transcript for the sender-attribution signature.
57
+ *
58
+ * The signed message commits to the file header (exactly the bytes under
59
+ * `header_mac`) and to EVERY chunk's full ciphertext field (body + AEAD
60
+ * tag), each length-framed and preceded by a domain separator:
61
+ *
62
+ * ```
63
+ * digest = SHA-256(
64
+ * SENDER_SIG_DOMAIN
65
+ * || u64be(len(header)) || header
66
+ * || u64be(total_chunks)
67
+ * || for each chunk i in order: u64be(i) || u64be(len(ct_i)) || ct_i
68
+ * )
69
+ * ```
44
70
  *
45
- * `header` MUST be the exact bytes covered by the file's `header_mac`
46
- * (i.e. the output of `buildHeaderUnauthenticated` or
47
- * `parseHeader().unauthenticatedBytes`). `chunkMacs` MUST be the per-chunk
48
- * AEAD tags in chunk-index order. For suites defined in v1 (AES-GCM-128,
49
- * ChaCha20-Poly1305) the tag is the trailing 16 bytes of the chunk's
50
- * ciphertext field.
71
+ * The 32-byte digest is what Ed25519 signs. Because the transcript binds
72
+ * the ciphertext bytes (not just the malleable per-chunk AEAD tags), a
73
+ * content-key holder cannot alter plaintext while keeping a signature
74
+ * valid: any change to a ciphertext byte changes the digest, and forging
75
+ * an Ed25519 signature over the new digest requires the signing key.
76
+ * Length-framing the chunk index and each ciphertext also binds chunk
77
+ * order and count, so truncation/reorder/splice change the digest too.
78
+ *
79
+ * Only the running SHA-256 state is retained, never the ciphertext, so
80
+ * signing or verifying a multi-gigabyte file uses O(1) memory.
81
+ */
82
+ export declare class SenderSigTranscript {
83
+ private readonly hash;
84
+ private headerAbsorbed;
85
+ constructor();
86
+ /**
87
+ * Absorb the header and the total chunk count. MUST be called exactly
88
+ * once, before any chunk. `header` MUST be the exact bytes covered by
89
+ * `header_mac` (`buildHeaderUnauthenticated` output /
90
+ * `parseHeader().unauthenticatedBytes`).
91
+ */
92
+ absorbHeader(header: Uint8Array, totalChunks: number): void;
93
+ /**
94
+ * Absorb one chunk's FULL ciphertext field (body + tag), in chunk-index
95
+ * order. The index and length are framed alongside the bytes so
96
+ * reordering or splicing a chunk changes the digest.
97
+ */
98
+ absorbChunk(chunkIndex: number, ciphertext: Uint8Array): void;
99
+ /** Finalize and return the 32-byte transcript digest. Single-use. */
100
+ digest(): Uint8Array;
101
+ }
102
+ /**
103
+ * Produce a detached Ed25519 signature over a {@link SenderSigTranscript}
104
+ * digest (see the class docstring for the transcript definition).
51
105
  *
52
106
  * Returns the raw 64-byte signature. Callers wrap it in a signature block
53
107
  * via `buildSignatureBlock`.
54
108
  */
55
- export declare function signHeaderAndMacs(input: {
109
+ export declare function signSenderTranscript(input: {
56
110
  ed25519SecretKey: Uint8Array;
57
- header: Uint8Array;
58
- chunkMacs: ReadonlyArray<Uint8Array>;
111
+ transcriptDigest: Uint8Array;
59
112
  }): Uint8Array;
60
113
  /**
61
- * Verify a detached Ed25519 signature produced by `signHeaderAndMacs`.
114
+ * Verify a detached Ed25519 signature produced by `signSenderTranscript`.
62
115
  * Returns `true` on success, `false` on any failure (wrong length,
63
116
  * malformed point, bad signature). Never throws on a verification
64
117
  * mismatch — failures are not exceptional.
65
118
  */
66
- export declare function verifyHeaderAndMacs(input: {
119
+ export declare function verifySenderTranscript(input: {
67
120
  ed25519PublicKey: Uint8Array;
68
- header: Uint8Array;
69
- chunkMacs: ReadonlyArray<Uint8Array>;
121
+ transcriptDigest: Uint8Array;
70
122
  signature: Uint8Array;
71
123
  }): boolean;
72
124
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/identity/sign.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAUH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,IAAO,CAAA;AAE1C,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,IAAO,CAAA;AAE5C,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAC3C,eAAO,MAAM,yBAAyB,KAAK,CAAA;AAC3C,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAA;IAC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