@seedprotocol/encryption 0.8.4-next.1913.g77fa9da → 0.8.4-next.1983.g8eb1851

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this package are documented in this file.
4
4
 
5
+ ## Unreleased
6
+
7
+ - `createEnvelopeDecryptor`'s decryptor returns null for bytes that aren't an envelope, as its type says. It threw `EnvelopeError('NOT_ENVELOPE')`. A damaged envelope still throws.
8
+ - SPEC.md is marked stable and says its test vectors are in the repository, not the package.
9
+
5
10
  ## 0.8.3 (2026-11-23)
6
11
 
7
12
  - `createEnvelopeDecryptor(identities)` returns the decryptor for the SDK's `setEnvelopeDecryptor`: it opens an envelope wrapped to any of the identities' recipient keys and returns null when none is a recipient.
package/SPEC.md CHANGED
@@ -6,7 +6,9 @@ follows [age](https://github.com/C2SP/C2SP/blob/main/age.md): a text header of r
6
6
  authenticated by an HMAC, then a STREAM payload of independently authenticated chunks. It differs
7
7
  from age in the key size, the cipher, the `bind` line and the content frame. ADR 0033 records why.
8
8
 
9
- Status: draft. Defined so far: the `mlkem768x25519` recipient stanza, the encryption identity and
9
+ Status: stable (ADR 0033 is Accepted).
10
+
11
+ Defined so far: the `mlkem768x25519` recipient stanza, the encryption identity and
10
12
  its key binding, and the keystore manifest with its `passkey-prf` and `eoa-signature` stanzas. Stanza types for readers'
11
13
  key grants and subscription epochs come with those features.
12
14
 
@@ -221,7 +223,8 @@ An envelope is uploaded with `Content-Type: application/octet-stream` and the ta
221
223
 
222
224
  ## Test vectors
223
225
 
224
- `__tests__/vectors.json` lists inputs and the resulting envelopes: the hex for envelopes up to
226
+ The vectors and tests below are in the repository under `packages/encryption/`, not in the npm
227
+ package. `__tests__/vectors.json` lists inputs and the resulting envelopes: the hex for envelopes up to
225
228
  4096 bytes, and the length and SHA-256 for all. All vectors use file key `00 01 ... 1f` and payload
226
229
  nonce `a0 a1 ... af`, and each names its `padding` (`padme` or `none`). They were produced by
227
230
  `__tests__/reference.ts`, a node:crypto implementation that shares no code with `src/`. The cases
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Opens downloaded envelopes for the SDK (`setEnvelopeDecryptor` in `@seedprotocol/sdk`): tries
3
3
  * each unlocked identity's recipient key and returns the plaintext with the content type recorded
4
- * inside, or null when none of them is a recipient.
4
+ * inside, or null when the bytes aren't an envelope or none of them is a recipient. A damaged
5
+ * envelope throws `EnvelopeError`.
5
6
  */
6
7
  import type { EncryptionIdentity } from './identity.js';
7
8
  /** What `setEnvelopeDecryptor` takes. Structural, so no SDK import. */
@@ -1 +1 @@
1
- {"version":3,"file":"envelopeDecryptor.d.ts","sourceRoot":"","sources":["../src/envelopeDecryptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAAC,CAAA;AAEhH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,cAAc,CAWxF"}
1
+ {"version":3,"file":"envelopeDecryptor.d.ts","sourceRoot":"","sources":["../src/envelopeDecryptor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAAC,CAAA;AAEhH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,kBAAkB,EAAE,GAAG,cAAc,CAWxF"}