@typedstandards/verify-core 0.7.0 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,14 @@ references are to `npstorey/civic-ai-tools-website` (#119 is the offline-crypto
6
6
  hardening arc; #116 is the standalone-verifier arc this package was extracted
7
7
  in).
8
8
 
9
+ ## 0.8.0 — 2026-08-01
10
+
11
+ - New export: `ED25519_SPKI_PREFIX` (`signature.ts`) — the fixed 12-byte
12
+ Ed25519 SPKI DER prefix this module asserts in `extractRawPublicKey`.
13
+ Previously duplicated locally by `@typedstandards/produce-core`'s
14
+ `derivePublicKeySpki`, which now imports it (typedstandards#36). No behavior
15
+ change; the bytes are identical.
16
+
9
17
  ## 0.7.0 — 2026-06-16
10
18
 
11
19
  - #1 envelope integrity is now TRI-STATE. `VerifyResult` gains an
@@ -1,3 +1,14 @@
1
+ /**
2
+ * The fixed 12-byte prefix of an Ed25519 public key in SPKI DER (SEQUENCE →
3
+ * AlgorithmIdentifier{ OID 1.3.101.112 } → BIT STRING, 0 unused bits); the
4
+ * full 44-byte structure is this prefix followed by the 32-byte raw key.
5
+ * Asserting the prefix + length before slicing the tail makes a malformed key
6
+ * throw rather than yield 32 arbitrary bytes — matching the old JWK path,
7
+ * which threw on a bad key. Exported (typedstandards#36) so producers
8
+ * assembling SPKI DER — `@typedstandards/produce-core`'s
9
+ * `derivePublicKeySpki` — build from the same bytes this module asserts.
10
+ */
11
+ export declare const ED25519_SPKI_PREFIX: Uint8Array<ArrayBuffer>;
1
12
  /**
2
13
  * Extract the raw 32-byte Ed25519 public key from a base64 SPKI DER encoding.
3
14
  * Browser-safe replacement for Node's `crypto.createPublicKey(...).export({jwk})`:
package/dist/signature.js CHANGED
@@ -8,12 +8,17 @@
8
8
  // reused as-is, INCLUDING the #111 algorithm dispatch.
9
9
  import { ed25519, ed25519ph } from '@noble/curves/ed25519.js';
10
10
  import { base64ToBytes, sha512Hex, utf8ToBytes } from "./primitives.js";
11
- // An Ed25519 public key in SPKI DER is a fixed 44-byte structure: a 12-byte
12
- // prefix (SEQUENCE → AlgorithmIdentifier{ OID 1.3.101.112 } → BIT STRING, 0
13
- // unused bits) followed by the 32-byte raw key. Asserting the prefix + length
14
- // before slicing the tail makes a malformed key throw rather than yield 32
15
- // arbitrary bytes — matching the old JWK path, which threw on a bad key.
16
- const ED25519_SPKI_PREFIX = Uint8Array.from([
11
+ /**
12
+ * The fixed 12-byte prefix of an Ed25519 public key in SPKI DER (SEQUENCE →
13
+ * AlgorithmIdentifier{ OID 1.3.101.112 } → BIT STRING, 0 unused bits); the
14
+ * full 44-byte structure is this prefix followed by the 32-byte raw key.
15
+ * Asserting the prefix + length before slicing the tail makes a malformed key
16
+ * throw rather than yield 32 arbitrary bytes — matching the old JWK path,
17
+ * which threw on a bad key. Exported (typedstandards#36) so producers
18
+ * assembling SPKI DER — `@typedstandards/produce-core`'s
19
+ * `derivePublicKeySpki` — build from the same bytes this module asserts.
20
+ */
21
+ export const ED25519_SPKI_PREFIX = Uint8Array.from([
17
22
  0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00,
18
23
  ]);
19
24
  const ED25519_SPKI_LENGTH = 44;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typedstandards/verify-core",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Portable, browser-safe verification core for Typed Standards evidence packages — the §9.2 check suite, single-sourced so it verifies identically on a server and in the browser.",
5
5
  "license": "MIT",
6
6
  "author": "Nathan Storey",