@hesohq/verify-wasm 0.4.3 → 0.5.0-dev.101
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/heso_wasm.d.ts +497 -43
- package/heso_wasm.js +1572 -252
- package/heso_wasm_bg.wasm +0 -0
- package/heso_wasm_bg.wasm.d.ts +111 -43
- package/package.json +9 -2
package/heso_wasm.d.ts
CHANGED
|
@@ -94,6 +94,238 @@ export class ChainResult {
|
|
|
94
94
|
set seq(value: number | null | undefined);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* The result of an offline CloudTrail feed-completeness check.
|
|
99
|
+
*/
|
|
100
|
+
export class CloudTrailFeedVerdict {
|
|
101
|
+
private constructor();
|
|
102
|
+
free(): void;
|
|
103
|
+
[Symbol.dispose](): void;
|
|
104
|
+
/**
|
|
105
|
+
* 0-based head-first index at which the chain broke / a digest was rejected;
|
|
106
|
+
* `None` for `Complete`.
|
|
107
|
+
*/
|
|
108
|
+
get broken_at(): number | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* 0-based head-first index at which the chain broke / a digest was rejected;
|
|
111
|
+
* `None` for `Complete`.
|
|
112
|
+
*/
|
|
113
|
+
set broken_at(value: number | null | undefined);
|
|
114
|
+
/**
|
|
115
|
+
* Number of hourly digests whose signature + chain link verified.
|
|
116
|
+
*/
|
|
117
|
+
digests_verified: number;
|
|
118
|
+
/**
|
|
119
|
+
* `true` ONLY when an unbroken signed chain proved completeness back to the
|
|
120
|
+
* starting (genesis) digest — the single state that earns a third-party
|
|
121
|
+
* `feed_complete` claim. A `ChainGap` (disclosed gap) reports `false`.
|
|
122
|
+
*/
|
|
123
|
+
feed_complete: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* The kind tag of the outcome: `"Complete"`, `"ChainGap"`, `"Empty"`,
|
|
126
|
+
* `"Malformed"`, `"NoMatchingKey"`, `"SignatureInvalid"`,
|
|
127
|
+
* `"PreviousHashMismatch"`, `"PreviousSignatureMismatch"`,
|
|
128
|
+
* `"PreviousObjectMismatch"`.
|
|
129
|
+
*/
|
|
130
|
+
kind: string;
|
|
131
|
+
/**
|
|
132
|
+
* Number of signed log files the verified digests committed to across the
|
|
133
|
+
* window. For `Complete` this is the SIGNED, COMPLETE inventory the window
|
|
134
|
+
* provably covers (no log file could have been added, removed, or modified
|
|
135
|
+
* without breaking the chain). `0` for non-window outcomes.
|
|
136
|
+
*/
|
|
137
|
+
signed_log_files_count: number;
|
|
138
|
+
/**
|
|
139
|
+
* The signed log-file inventory as a JSON array of
|
|
140
|
+
* `{s3_bucket, s3_object, hash_value, …}` — the proof page renders these so a
|
|
141
|
+
* third party can confirm WHICH files the window covers. `"[]"` for
|
|
142
|
+
* non-window outcomes.
|
|
143
|
+
*/
|
|
144
|
+
signed_log_files_json: string;
|
|
145
|
+
/**
|
|
146
|
+
* `digestEndTime` of the head digest (window upper bound). `None` unless the
|
|
147
|
+
* outcome carries a window.
|
|
148
|
+
*/
|
|
149
|
+
get window_end(): string | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* `digestEndTime` of the head digest (window upper bound). `None` unless the
|
|
152
|
+
* outcome carries a window.
|
|
153
|
+
*/
|
|
154
|
+
set window_end(value: string | null | undefined);
|
|
155
|
+
/**
|
|
156
|
+
* `digestEndTime` of the starting digest reached (`Complete`) or the last
|
|
157
|
+
* verified digest before the gap (`ChainGap`). `None` otherwise.
|
|
158
|
+
*/
|
|
159
|
+
get window_start(): string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* `digestEndTime` of the starting digest reached (`Complete`) or the last
|
|
162
|
+
* verified digest before the gap (`ChainGap`). `None` otherwise.
|
|
163
|
+
*/
|
|
164
|
+
set window_start(value: string | null | undefined);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The kind-tagged verdict of [`verify_commitment_wasm`]. `verdict` is one of
|
|
169
|
+
* `"Valid"`, `"InvalidSignature"`, `"FingerprintMismatch"`, `"WrongAlgorithm"`,
|
|
170
|
+
* `"Malformed"`; a recipient accepts the commitment ONLY on `"Valid"`.
|
|
171
|
+
* `signer_fpr` carries the recomputed `blake3(pubkey)` fingerprint (only
|
|
172
|
+
* meaningful on `"Valid"`).
|
|
173
|
+
*/
|
|
174
|
+
export class CommitmentVerdict {
|
|
175
|
+
private constructor();
|
|
176
|
+
free(): void;
|
|
177
|
+
[Symbol.dispose](): void;
|
|
178
|
+
/**
|
|
179
|
+
* The recomputed `blake3(pubkey)` fingerprint (only set on `"Valid"`).
|
|
180
|
+
*/
|
|
181
|
+
signer_fpr: string;
|
|
182
|
+
/**
|
|
183
|
+
* The verdict tag.
|
|
184
|
+
*/
|
|
185
|
+
verdict: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* The base verdict + the rendered signed metrics + the offline-recomputed cost.
|
|
190
|
+
*
|
|
191
|
+
* `verdict` / `trust_level` are exactly what [`verify_action_receipt_wasm`]
|
|
192
|
+
* returns. The metric fields are the SIGNED values (the closed `status` /
|
|
193
|
+
* `token_source` enums rendered to their wire snake_case strings). `cost_display`
|
|
194
|
+
* / `recomputed_cost_micros` are RECOMPUTED from the rate card the caller passed
|
|
195
|
+
* in — `priced == false` (and both `None`) when that card does not price the
|
|
196
|
+
* model; never a guessed figure. `card_id_matches` tells the reader whether the
|
|
197
|
+
* card handed in is the one the receipt actually named.
|
|
198
|
+
*/
|
|
199
|
+
export class MetricsVerdict {
|
|
200
|
+
private constructor();
|
|
201
|
+
free(): void;
|
|
202
|
+
[Symbol.dispose](): void;
|
|
203
|
+
/**
|
|
204
|
+
* Request bytes sent, when the transport exposed it.
|
|
205
|
+
*/
|
|
206
|
+
get bytes_in(): number | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* Request bytes sent, when the transport exposed it.
|
|
209
|
+
*/
|
|
210
|
+
set bytes_in(value: number | null | undefined);
|
|
211
|
+
/**
|
|
212
|
+
* Response bytes received, when the transport exposed it.
|
|
213
|
+
*/
|
|
214
|
+
get bytes_out(): number | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* Response bytes received, when the transport exposed it.
|
|
217
|
+
*/
|
|
218
|
+
set bytes_out(value: number | null | undefined);
|
|
219
|
+
/**
|
|
220
|
+
* Whether the passed-in card is the one the receipt named.
|
|
221
|
+
*/
|
|
222
|
+
card_id_matches: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Recomputed cost as a 6-decimal display string; `None` when not priced.
|
|
225
|
+
*/
|
|
226
|
+
get cost_display(): string | undefined;
|
|
227
|
+
/**
|
|
228
|
+
* Recomputed cost as a 6-decimal display string; `None` when not priced.
|
|
229
|
+
*/
|
|
230
|
+
set cost_display(value: string | null | undefined);
|
|
231
|
+
/**
|
|
232
|
+
* Wall-clock duration in whole milliseconds.
|
|
233
|
+
*/
|
|
234
|
+
get duration_ms(): number | undefined;
|
|
235
|
+
/**
|
|
236
|
+
* Wall-clock duration in whole milliseconds.
|
|
237
|
+
*/
|
|
238
|
+
set duration_ms(value: number | null | undefined);
|
|
239
|
+
/**
|
|
240
|
+
* Whether the receipt carried a signed `metrics` block.
|
|
241
|
+
*/
|
|
242
|
+
has_metrics: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* The `provider/model` key derived from the signed `action.fields`.
|
|
245
|
+
*/
|
|
246
|
+
get model_key(): string | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* The `provider/model` key derived from the signed `action.fields`.
|
|
249
|
+
*/
|
|
250
|
+
set model_key(value: string | null | undefined);
|
|
251
|
+
/**
|
|
252
|
+
* `true` iff the model is priced by the passed-in card.
|
|
253
|
+
*/
|
|
254
|
+
priced: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* The rate-card id AS NAMED in the signed receipt.
|
|
257
|
+
*/
|
|
258
|
+
get rate_card_id(): string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* The rate-card id AS NAMED in the signed receipt.
|
|
261
|
+
*/
|
|
262
|
+
set rate_card_id(value: string | null | undefined);
|
|
263
|
+
/**
|
|
264
|
+
* Recomputed cost in micro-USD (`BigInt`); `None` when not priced.
|
|
265
|
+
*/
|
|
266
|
+
get recomputed_cost_micros(): bigint | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* Recomputed cost in micro-USD (`BigInt`); `None` when not priced.
|
|
269
|
+
*/
|
|
270
|
+
set recomputed_cost_micros(value: bigint | null | undefined);
|
|
271
|
+
/**
|
|
272
|
+
* Transport-level retries before this outcome.
|
|
273
|
+
*/
|
|
274
|
+
get retries(): number | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* Transport-level retries before this outcome.
|
|
277
|
+
*/
|
|
278
|
+
set retries(value: number | null | undefined);
|
|
279
|
+
/**
|
|
280
|
+
* Transport status code, when one applied.
|
|
281
|
+
*/
|
|
282
|
+
get status_code(): number | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* Transport status code, when one applied.
|
|
285
|
+
*/
|
|
286
|
+
set status_code(value: number | null | undefined);
|
|
287
|
+
/**
|
|
288
|
+
* Execution-outcome class, wire snake_case (`"ok"`, `"server_error"`, …).
|
|
289
|
+
*/
|
|
290
|
+
get status(): string | undefined;
|
|
291
|
+
/**
|
|
292
|
+
* Execution-outcome class, wire snake_case (`"ok"`, `"server_error"`, …).
|
|
293
|
+
*/
|
|
294
|
+
set status(value: string | null | undefined);
|
|
295
|
+
/**
|
|
296
|
+
* Token-count source, wire snake_case (`"provider_reported"`/`"estimated"`).
|
|
297
|
+
*/
|
|
298
|
+
get token_source(): string | undefined;
|
|
299
|
+
/**
|
|
300
|
+
* Token-count source, wire snake_case (`"provider_reported"`/`"estimated"`).
|
|
301
|
+
*/
|
|
302
|
+
set token_source(value: string | null | undefined);
|
|
303
|
+
/**
|
|
304
|
+
* Provider-reported (or estimated) input tokens.
|
|
305
|
+
*/
|
|
306
|
+
get tokens_in(): number | undefined;
|
|
307
|
+
/**
|
|
308
|
+
* Provider-reported (or estimated) input tokens.
|
|
309
|
+
*/
|
|
310
|
+
set tokens_in(value: number | null | undefined);
|
|
311
|
+
/**
|
|
312
|
+
* Provider-reported (or estimated) output tokens.
|
|
313
|
+
*/
|
|
314
|
+
get tokens_out(): number | undefined;
|
|
315
|
+
/**
|
|
316
|
+
* Provider-reported (or estimated) output tokens.
|
|
317
|
+
*/
|
|
318
|
+
set tokens_out(value: number | null | undefined);
|
|
319
|
+
/**
|
|
320
|
+
* The re-derived trust level (`"L0"`/`"L1"`); `""` unless `verdict == "Valid"`.
|
|
321
|
+
*/
|
|
322
|
+
trust_level: string;
|
|
323
|
+
/**
|
|
324
|
+
* The base `ActionOutcome` verdict tag (`"Valid"`, `"HashMismatch"`, …).
|
|
325
|
+
*/
|
|
326
|
+
verdict: string;
|
|
327
|
+
}
|
|
328
|
+
|
|
97
329
|
/**
|
|
98
330
|
* The verified, decoded result of a delegation envelope.
|
|
99
331
|
*/
|
|
@@ -136,12 +368,71 @@ export function actionCanonicalBytes(content_json: string): Uint8Array;
|
|
|
136
368
|
*/
|
|
137
369
|
export function anchoredContentHash(content_json: string): string;
|
|
138
370
|
|
|
371
|
+
/**
|
|
372
|
+
* Assemble the on-the-wire approval-token frame from the detached signature the
|
|
373
|
+
* in-browser approver key produced over [`approval_token_payload_wasm`]. Pure
|
|
374
|
+
* assemble, no key. The base64 of these bytes is the bearer `token_b64`.
|
|
375
|
+
*
|
|
376
|
+
* Byte order (see [`heso_action::domain::approval_token_frame`], the ONE source —
|
|
377
|
+
* the kernel verifier parses EXACTLY this and rejects trailing bytes):
|
|
378
|
+
* `nonce(32) ++ expiry(BE8) ++ decision_tag(1) ++ scope_len(BE4) ++ scope
|
|
379
|
+
* ++ signature(64) ++ pubkey(32)`
|
|
380
|
+
*
|
|
381
|
+
* `nonce` — 32 raw bytes (Uint8Array); MUST equal the nonce signed over.
|
|
382
|
+
* `expiryUnixSecs` — token expiry as BigInt Unix seconds.
|
|
383
|
+
* `decision` — `"approved"` or `"rejected"`.
|
|
384
|
+
* `scope` — the UTF-8 scope string.
|
|
385
|
+
* `signature` — 64 raw Ed25519 signature bytes (Uint8Array).
|
|
386
|
+
* `pubkey` — 32 raw Ed25519 public-key bytes (Uint8Array).
|
|
387
|
+
*/
|
|
388
|
+
export function approvalTokenFrame(nonce: Uint8Array, expiry_unix_secs: bigint, decision: string, scope: string, signature: Uint8Array, pubkey: Uint8Array): Uint8Array;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Return the EXACT bytes the approver's Ed25519 key must sign for an approval
|
|
392
|
+
* token (the Option-C in-browser minter signs THESE, never any hand-rolled
|
|
393
|
+
* bytes). Mirrors [`l1_cosign_payload_wasm`]: pure assemble, no OsRng, no key —
|
|
394
|
+
* the browser holds the key, this only produces the payload a detached signer
|
|
395
|
+
* covers.
|
|
396
|
+
*
|
|
397
|
+
* Byte order (see [`heso_action::domain::approval_token_signed_payload`], the ONE
|
|
398
|
+
* source — the kernel verifier recomputes the identical bytes):
|
|
399
|
+
* `APPROVAL_TOKEN_SIGNING_DOMAIN ++ nonce(32) ++ expiry(BE8) ++ decision_tag(1)
|
|
400
|
+
* ++ scope_len(BE4) ++ scope ++ action_canonical_bytes`
|
|
401
|
+
*
|
|
402
|
+
* `contentJson` — the `ActionContent` JSON; canonicalized through the SAME
|
|
403
|
+
* RFC-8785 path as [`action_canonical_bytes_wasm`] (the
|
|
404
|
+
* browser MUST NOT hand-roll JCS).
|
|
405
|
+
* `nonce` — 32 raw replay-prevention bytes (Uint8Array).
|
|
406
|
+
* `expiryUnixSecs` — token expiry as BigInt Unix seconds.
|
|
407
|
+
* `decision` — `"approved"` or `"rejected"` (the SEC-02 decision binding).
|
|
408
|
+
* `scope` — the UTF-8 scope string.
|
|
409
|
+
*/
|
|
410
|
+
export function approvalTokenPayload(content_json: string, nonce: Uint8Array, expiry_unix_secs: bigint, decision: string, scope: string): Uint8Array;
|
|
411
|
+
|
|
139
412
|
/**
|
|
140
413
|
* Compute a domain-separated BLAKE3 chain-link digest from two 64-hex hashes.
|
|
141
414
|
* Replaces the `@noble`-backed chain helper in `crypto.ts`.
|
|
142
415
|
*/
|
|
143
416
|
export function chainHashHex(prev_hex: string, action_hex: string): string;
|
|
144
417
|
|
|
418
|
+
/**
|
|
419
|
+
* PURE. Return the RFC-8785 (JCS) canonical bytes of a commitment envelope JSON
|
|
420
|
+
* string — the exact bytes the detached operator signature is computed over
|
|
421
|
+
* (after the `COMMITMENT_SIGNING_DOMAIN` prefix). Delegates to the single kernel
|
|
422
|
+
* JCS impl; never re-canonicalizes. Throws `[MALFORMED]` if the JSON does not
|
|
423
|
+
* parse as a `CommitmentEnvelope` and `[CANON]` if it cannot be canonicalized.
|
|
424
|
+
*/
|
|
425
|
+
export function commitmentEnvelopeCanonicalBytes(envelope_json: string): Uint8Array;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* The **commitment fingerprint** of an Ed25519 public key: `blake3(raw_pubkey)`,
|
|
429
|
+
* the full 32-byte digest, lowercase 64-hex, NO prefix — the value the producer
|
|
430
|
+
* puts in the wire `signer_fpr`. DISTINCT from the `heso:`-prefixed Grade-0
|
|
431
|
+
* signer fingerprint. Throws `[MALFORMED]` if `pubkey_b64` is not base64 of
|
|
432
|
+
* exactly 32 bytes.
|
|
433
|
+
*/
|
|
434
|
+
export function commitmentFingerprint(pubkey_b64: string): string;
|
|
435
|
+
|
|
145
436
|
/**
|
|
146
437
|
* BLAKE3 (64-hex) of the canonical bytes — the value that goes into
|
|
147
438
|
* `action_hash`. Replaces `@noble/hashes` blake3 usage in `crypto.ts`.
|
|
@@ -193,6 +484,13 @@ export function l1CosignPayload(suspended_content_json: string, approver_record_
|
|
|
193
484
|
*/
|
|
194
485
|
export function parsePolicy(toml_src: string): void;
|
|
195
486
|
|
|
487
|
+
/**
|
|
488
|
+
* Parse a C2SP signed-note checkpoint and return its `{origin, size, root_hex,
|
|
489
|
+
* text}` as a JSON string. Does NO signature verification — call
|
|
490
|
+
* `verifyNoteAgainstKey` for that. Throws `[NOTE]` on a malformed note.
|
|
491
|
+
*/
|
|
492
|
+
export function parseSignedNote(note: string): string;
|
|
493
|
+
|
|
196
494
|
/**
|
|
197
495
|
* Parse + validate policy TOML and return the rules as a JSON array of
|
|
198
496
|
* [`PolicyRule`] (the Rust wire shape) so the web renders a pulled policy via the
|
|
@@ -244,6 +542,14 @@ export function ruleToSentence(rule_json: string): string;
|
|
|
244
542
|
*/
|
|
245
543
|
export function shortHash(hex: string, prefix?: string | null): string;
|
|
246
544
|
|
|
545
|
+
/**
|
|
546
|
+
* The frozen top-tree leaf VALUE committing one org's epoch snapshot:
|
|
547
|
+
* `SHA-256(TOP_LEAF_DOMAIN || org_id(16) || epoch(BE8) || org_root(32))`,
|
|
548
|
+
* 64-hex. The stage-2 commitment a two-stage inclusion proof rides. Throws
|
|
549
|
+
* `[ORG]`/`[ROOT]` on malformed inputs.
|
|
550
|
+
*/
|
|
551
|
+
export function topLeafValue(org_id_hyphenated: string, epoch: bigint, org_root_hex: string): string;
|
|
552
|
+
|
|
247
553
|
/**
|
|
248
554
|
* Floor pre-check over a candidate ruleset (JSON array of [`PolicyRule`]) WITHOUT
|
|
249
555
|
* serializing to TOML — the live check the builder runs as the user edits.
|
|
@@ -267,6 +573,25 @@ export function validateNoFloorBypass(rules_json: string): void;
|
|
|
267
573
|
*/
|
|
268
574
|
export function verifyActionReceipt(receipt_bytes: Uint8Array): ActionVerdict;
|
|
269
575
|
|
|
576
|
+
/**
|
|
577
|
+
* Verify a single `ActionReceipt` AND render its signed metrics + recompute cost
|
|
578
|
+
* from the passed-in public rate card.
|
|
579
|
+
*
|
|
580
|
+
* Runs the EXISTING [`verify_action_receipt`] for the base outcome + trust level
|
|
581
|
+
* (so that path is byte-for-byte unchanged), then — when the receipt parses —
|
|
582
|
+
* renders the signed metrics and recomputes the cost via the pure
|
|
583
|
+
* `heso_action::metrics_view::metrics_view`. Never panics:
|
|
584
|
+
*
|
|
585
|
+
* - receipt fails to PARSE ⇒ base verdict + `has_metrics: false` (no metrics).
|
|
586
|
+
* - rate card fails to PARSE ⇒ base verdict + rendered metrics, but `priced:
|
|
587
|
+
* false` and `cost_display: None` (cost cannot be recomputed without a card).
|
|
588
|
+
* - everything parses ⇒ full metrics + recomputed cost.
|
|
589
|
+
*
|
|
590
|
+
* `receipt_bytes` — the raw `ActionReceipt` JSON bytes (`Uint8Array`).
|
|
591
|
+
* `rate_card_json` — the public rate-card JSON the cost is recomputed from.
|
|
592
|
+
*/
|
|
593
|
+
export function verifyActionReceiptWithRates(receipt_bytes: Uint8Array, rate_card_json: string): MetricsVerdict;
|
|
594
|
+
|
|
270
595
|
/**
|
|
271
596
|
* Verify a serialized approval token and return its decoded claims.
|
|
272
597
|
*
|
|
@@ -292,6 +617,42 @@ export function verifyApprovalToken(token: Uint8Array, action_canonical: Uint8Ar
|
|
|
292
617
|
*/
|
|
293
618
|
export function verifyChain(receipts_bytes: Uint8Array): ChainResult;
|
|
294
619
|
|
|
620
|
+
/**
|
|
621
|
+
* **REJECT-MORE-ONLY.** Verify an AWS CloudTrail signed digest-file chain
|
|
622
|
+
* **offline**, proving feed completeness from the frozen bundle bytes + the
|
|
623
|
+
* PINNED AWS public keys alone — no network, no AWS call, no HESO endpoint.
|
|
624
|
+
*
|
|
625
|
+
* `proof_json` is a [`heso_action::cloudtrail::CloudTrailFeedProof`] JSON: the
|
|
626
|
+
* digest chain (HEAD FIRST), the head's out-of-band `x-amz-meta-signature`, and
|
|
627
|
+
* the pinned per-Region AWS public keys (PKCS#1 DER, base64 — exactly as
|
|
628
|
+
* `ListPublicKeys` returns them; this verifier wraps them into SPKI internally,
|
|
629
|
+
* the #1 implementation trap handled once in the kernel).
|
|
630
|
+
*
|
|
631
|
+
* The AWS key is trusted **out of band** (CT pin-the-key model): a digest whose
|
|
632
|
+
* `digestPublicKeyFingerprint` matches no pinned key FAILS with
|
|
633
|
+
* `kind = "NoMatchingKey"`. The verdict separates `feed_complete` (window
|
|
634
|
+
* completeness, claimable to a third party for this STRONG rail) from a
|
|
635
|
+
* disclosed `ChainGap` — never collapsing a gap into a green badge.
|
|
636
|
+
*
|
|
637
|
+
* Throws `[CT_PARSE]` only if `proof_json` is not a valid `CloudTrailFeedProof`;
|
|
638
|
+
* every cryptographic / chain failure is a non-throwing kind tag instead.
|
|
639
|
+
*/
|
|
640
|
+
export function verifyCloudTrailFeed(proof_json: string): CloudTrailFeedVerdict;
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* REJECT-MORE-ONLY. Verify a detached commitment-envelope signature in the
|
|
644
|
+
* browser — the recipient independently confirms a commitment the same way the
|
|
645
|
+
* cloud does.
|
|
646
|
+
*
|
|
647
|
+
* Parses `envelope_bytes` as a `CommitmentEnvelope`, re-canonicalizes VIA THE
|
|
648
|
+
* KERNEL, `verify_strict`-checks the detached Ed25519 signature under
|
|
649
|
+
* `COMMITMENT_SIGNING_DOMAIN`, and confirms the recomputed commitment
|
|
650
|
+
* fingerprint (`blake3(pubkey)`) equals `claimed_signer_fpr`. Produces ZERO new
|
|
651
|
+
* canonical/signed bytes. Never throws — every outcome is a kind-tagged
|
|
652
|
+
* [`CommitmentVerdict`].
|
|
653
|
+
*/
|
|
654
|
+
export function verifyCommitment(envelope_bytes: Uint8Array, operator_pubkey_b64: string, detached_sig_b64: string, claimed_signer_fpr: string): CommitmentVerdict;
|
|
655
|
+
|
|
295
656
|
/**
|
|
296
657
|
* RFC-6962 consistency proof verification.
|
|
297
658
|
*
|
|
@@ -329,6 +690,31 @@ export function verifyDelegation(wire: Uint8Array, registered_operator_key: Uint
|
|
|
329
690
|
*/
|
|
330
691
|
export function verifyInclusion(leaf_value_hex: string, index: number, size: number, root_hex: string, proof_hashes_json: string): boolean;
|
|
331
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Verify a parsed C2SP signed-note checkpoint against a PINNED Ed25519 log
|
|
695
|
+
* public key (base64, raw 32 bytes). Returns `true` iff at least one signature
|
|
696
|
+
* line is from the pinned key AND `verify_strict`s over the note text.
|
|
697
|
+
*
|
|
698
|
+
* The pinned key is supplied by the caller (trusted out of band, CT-style) — a
|
|
699
|
+
* note signed by any non-pinned key returns `false`. Throws `[NOTE]` if the
|
|
700
|
+
* note is malformed or `[KEY]` if the pubkey is not base64 of 32 bytes.
|
|
701
|
+
*/
|
|
702
|
+
export function verifyNoteAgainstKey(note: string, log_pubkey_b64: string): boolean;
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* Verify a single commit-and-reveal field reveal against its signed redaction
|
|
706
|
+
* marker — recompute `BLAKE3(salt ++ field_path ++ value)` and check equality
|
|
707
|
+
* with `marker.commitment`. The browser/offline counterpart to the Node
|
|
708
|
+
* `verifyRevealJs`: the missing half that lets a web auditor reveal-and-prove a
|
|
709
|
+
* redacted field with only the receipt + the customer-supplied sidecar.
|
|
710
|
+
*
|
|
711
|
+
* `reveal_json` — a `FieldReveal`: `{ field_path, salt_hex, value_json }`.
|
|
712
|
+
* `marker_json` — the matching `RedactionMarker` from the signed receipt.
|
|
713
|
+
*
|
|
714
|
+
* Returns `true` iff the reveal recomputes the marker's commitment.
|
|
715
|
+
*/
|
|
716
|
+
export function verifyReveal(reveal_json: string, marker_json: string): boolean;
|
|
717
|
+
|
|
332
718
|
/**
|
|
333
719
|
* Verify a session chain (lifecycle role + transition checks).
|
|
334
720
|
*/
|
|
@@ -347,68 +733,136 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
347
733
|
export interface InitOutput {
|
|
348
734
|
readonly memory: WebAssembly.Memory;
|
|
349
735
|
readonly __wbg_actionverdict_free: (a: number, b: number) => void;
|
|
350
|
-
readonly __wbg_get_actionverdict_verdict: (a: number) =>
|
|
736
|
+
readonly __wbg_get_actionverdict_verdict: (a: number, b: number) => void;
|
|
351
737
|
readonly __wbg_set_actionverdict_verdict: (a: number, b: number, c: number) => void;
|
|
352
|
-
readonly __wbg_get_actionverdict_trust_level: (a: number) =>
|
|
738
|
+
readonly __wbg_get_actionverdict_trust_level: (a: number, b: number) => void;
|
|
353
739
|
readonly __wbg_set_actionverdict_trust_level: (a: number, b: number, c: number) => void;
|
|
354
740
|
readonly __wbg_chainresult_free: (a: number, b: number) => void;
|
|
355
741
|
readonly __wbg_get_chainresult_ok: (a: number) => number;
|
|
356
742
|
readonly __wbg_set_chainresult_ok: (a: number, b: number) => void;
|
|
357
743
|
readonly __wbg_get_chainresult_length: (a: number) => number;
|
|
358
744
|
readonly __wbg_set_chainresult_length: (a: number, b: number) => void;
|
|
359
|
-
readonly __wbg_get_chainresult_error: (a: number) =>
|
|
745
|
+
readonly __wbg_get_chainresult_error: (a: number, b: number) => void;
|
|
360
746
|
readonly __wbg_set_chainresult_error: (a: number, b: number, c: number) => void;
|
|
361
747
|
readonly __wbg_get_chainresult_seq: (a: number) => number;
|
|
362
748
|
readonly __wbg_set_chainresult_seq: (a: number, b: number) => void;
|
|
363
|
-
readonly __wbg_get_chainresult_detail: (a: number) =>
|
|
749
|
+
readonly __wbg_get_chainresult_detail: (a: number, b: number) => void;
|
|
364
750
|
readonly __wbg_set_chainresult_detail: (a: number, b: number, c: number) => void;
|
|
365
751
|
readonly __wbg_approvaltokenclaims_free: (a: number, b: number) => void;
|
|
366
|
-
readonly __wbg_get_approvaltokenclaims_nonce: (a: number) =>
|
|
367
|
-
readonly __wbg_set_approvaltokenclaims_nonce: (a: number, b:
|
|
368
|
-
readonly __wbg_get_approvaltokenclaims_expiry_unix_secs: (a: number) =>
|
|
369
|
-
readonly __wbg_set_approvaltokenclaims_expiry_unix_secs: (a: number, b:
|
|
370
|
-
readonly
|
|
371
|
-
readonly __wbg_get_approvaltokenclaims_scope: (a: number) => [number, number];
|
|
372
|
-
readonly __wbg_get_approvaltokenclaims_approver_public_key: (a: number) => [number, number];
|
|
752
|
+
readonly __wbg_get_approvaltokenclaims_nonce: (a: number) => number;
|
|
753
|
+
readonly __wbg_set_approvaltokenclaims_nonce: (a: number, b: number) => void;
|
|
754
|
+
readonly __wbg_get_approvaltokenclaims_expiry_unix_secs: (a: number) => number;
|
|
755
|
+
readonly __wbg_set_approvaltokenclaims_expiry_unix_secs: (a: number, b: number) => void;
|
|
756
|
+
readonly __wbg_get_approvaltokenclaims_approver_public_key: (a: number, b: number) => void;
|
|
373
757
|
readonly __wbg_set_approvaltokenclaims_approver_public_key: (a: number, b: number, c: number) => void;
|
|
374
758
|
readonly __wbg_verifieddelegation_free: (a: number, b: number) => void;
|
|
375
|
-
readonly __wbg_get_verifieddelegation_authorized_key: (a: number) =>
|
|
376
|
-
readonly __wbg_set_verifieddelegation_authorized_key: (a: number, b:
|
|
377
|
-
readonly
|
|
378
|
-
readonly
|
|
379
|
-
readonly
|
|
380
|
-
readonly
|
|
381
|
-
readonly __wbg_get_verifieddelegation_not_before_unix_secs: (a: number) => any;
|
|
382
|
-
readonly __wbg_set_verifieddelegation_not_before_unix_secs: (a: number, b: any) => void;
|
|
759
|
+
readonly __wbg_get_verifieddelegation_authorized_key: (a: number) => number;
|
|
760
|
+
readonly __wbg_set_verifieddelegation_authorized_key: (a: number, b: number) => void;
|
|
761
|
+
readonly __wbg_get_verifieddelegation_expiry_unix_secs: (a: number) => number;
|
|
762
|
+
readonly __wbg_set_verifieddelegation_expiry_unix_secs: (a: number, b: number) => void;
|
|
763
|
+
readonly __wbg_get_verifieddelegation_not_before_unix_secs: (a: number) => number;
|
|
764
|
+
readonly __wbg_set_verifieddelegation_not_before_unix_secs: (a: number, b: number) => void;
|
|
383
765
|
readonly verifyActionReceipt: (a: number, b: number) => number;
|
|
384
|
-
readonly actionCanonicalBytes: (a: number, b: number
|
|
385
|
-
readonly l1CosignPayload: (a: number, b: number, c: number, d: number
|
|
386
|
-
readonly quorumCosignPayload: (a: number, b: number, c: number, d: number, e: number, f: number, g: number
|
|
387
|
-
readonly contentHash: (a: number, b: number
|
|
388
|
-
readonly anchoredContentHash: (a: number, b: number
|
|
389
|
-
readonly shortHash: (a: number, b: number, c: number, d: number
|
|
390
|
-
readonly chainHashHex: (a: number, b: number, c: number, d: number
|
|
391
|
-
readonly verifyApprovalToken: (a: number, b: number, c: number, d: number, e:
|
|
392
|
-
readonly
|
|
393
|
-
readonly
|
|
394
|
-
readonly
|
|
395
|
-
readonly
|
|
396
|
-
readonly
|
|
397
|
-
readonly
|
|
398
|
-
readonly
|
|
399
|
-
readonly
|
|
400
|
-
readonly
|
|
401
|
-
readonly
|
|
766
|
+
readonly actionCanonicalBytes: (a: number, b: number, c: number) => void;
|
|
767
|
+
readonly l1CosignPayload: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
768
|
+
readonly quorumCosignPayload: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
769
|
+
readonly contentHash: (a: number, b: number, c: number) => void;
|
|
770
|
+
readonly anchoredContentHash: (a: number, b: number, c: number) => void;
|
|
771
|
+
readonly shortHash: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
772
|
+
readonly chainHashHex: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
773
|
+
readonly verifyApprovalToken: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
774
|
+
readonly approvalTokenPayload: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
775
|
+
readonly approvalTokenFrame: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => void;
|
|
776
|
+
readonly verifyDelegation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number) => void;
|
|
777
|
+
readonly verifyCommitment: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
778
|
+
readonly commitmentEnvelopeCanonicalBytes: (a: number, b: number, c: number) => void;
|
|
779
|
+
readonly commitmentFingerprint: (a: number, b: number, c: number) => void;
|
|
780
|
+
readonly parseSignedNote: (a: number, b: number, c: number) => void;
|
|
781
|
+
readonly verifyNoteAgainstKey: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
782
|
+
readonly topLeafValue: (a: number, b: number, c: number, d: bigint, e: number, f: number) => void;
|
|
783
|
+
readonly verifyChain: (a: number, b: number, c: number) => void;
|
|
784
|
+
readonly verifySessionChain: (a: number, b: number, c: number) => void;
|
|
785
|
+
readonly verifySessionChainWithRotation: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
786
|
+
readonly verifyInclusion: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
787
|
+
readonly verifyConsistency: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
788
|
+
readonly verifyReveal: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
789
|
+
readonly parsePolicy: (a: number, b: number, c: number) => void;
|
|
790
|
+
readonly ruleToSentence: (a: number, b: number, c: number) => void;
|
|
791
|
+
readonly policyRulesFromToml: (a: number, b: number, c: number) => void;
|
|
792
|
+
readonly validateNoFloorBypass: (a: number, b: number, c: number) => void;
|
|
793
|
+
readonly __wbg_metricsverdict_free: (a: number, b: number) => void;
|
|
794
|
+
readonly __wbg_get_metricsverdict_verdict: (a: number, b: number) => void;
|
|
795
|
+
readonly __wbg_set_metricsverdict_verdict: (a: number, b: number, c: number) => void;
|
|
796
|
+
readonly __wbg_get_metricsverdict_trust_level: (a: number, b: number) => void;
|
|
797
|
+
readonly __wbg_set_metricsverdict_trust_level: (a: number, b: number, c: number) => void;
|
|
798
|
+
readonly __wbg_get_metricsverdict_has_metrics: (a: number) => number;
|
|
799
|
+
readonly __wbg_set_metricsverdict_has_metrics: (a: number, b: number) => void;
|
|
800
|
+
readonly __wbg_get_metricsverdict_duration_ms: (a: number) => number;
|
|
801
|
+
readonly __wbg_set_metricsverdict_duration_ms: (a: number, b: number) => void;
|
|
802
|
+
readonly __wbg_get_metricsverdict_status: (a: number, b: number) => void;
|
|
803
|
+
readonly __wbg_set_metricsverdict_status: (a: number, b: number, c: number) => void;
|
|
804
|
+
readonly __wbg_get_metricsverdict_status_code: (a: number) => number;
|
|
805
|
+
readonly __wbg_set_metricsverdict_status_code: (a: number, b: number) => void;
|
|
806
|
+
readonly __wbg_get_metricsverdict_tokens_in: (a: number) => number;
|
|
807
|
+
readonly __wbg_set_metricsverdict_tokens_in: (a: number, b: number) => void;
|
|
808
|
+
readonly __wbg_get_metricsverdict_tokens_out: (a: number) => number;
|
|
809
|
+
readonly __wbg_set_metricsverdict_tokens_out: (a: number, b: number) => void;
|
|
810
|
+
readonly __wbg_get_metricsverdict_token_source: (a: number, b: number) => void;
|
|
811
|
+
readonly __wbg_set_metricsverdict_token_source: (a: number, b: number, c: number) => void;
|
|
812
|
+
readonly __wbg_get_metricsverdict_bytes_in: (a: number) => number;
|
|
813
|
+
readonly __wbg_set_metricsverdict_bytes_in: (a: number, b: number) => void;
|
|
814
|
+
readonly __wbg_get_metricsverdict_bytes_out: (a: number) => number;
|
|
815
|
+
readonly __wbg_set_metricsverdict_bytes_out: (a: number, b: number) => void;
|
|
816
|
+
readonly __wbg_get_metricsverdict_retries: (a: number) => number;
|
|
817
|
+
readonly __wbg_set_metricsverdict_retries: (a: number, b: number) => void;
|
|
818
|
+
readonly __wbg_get_metricsverdict_rate_card_id: (a: number, b: number) => void;
|
|
819
|
+
readonly __wbg_set_metricsverdict_rate_card_id: (a: number, b: number, c: number) => void;
|
|
820
|
+
readonly __wbg_get_metricsverdict_model_key: (a: number, b: number) => void;
|
|
821
|
+
readonly __wbg_set_metricsverdict_model_key: (a: number, b: number, c: number) => void;
|
|
822
|
+
readonly __wbg_get_metricsverdict_recomputed_cost_micros: (a: number, b: number) => void;
|
|
823
|
+
readonly __wbg_set_metricsverdict_recomputed_cost_micros: (a: number, b: number, c: bigint) => void;
|
|
824
|
+
readonly __wbg_get_metricsverdict_cost_display: (a: number, b: number) => void;
|
|
825
|
+
readonly __wbg_set_metricsverdict_cost_display: (a: number, b: number, c: number) => void;
|
|
826
|
+
readonly __wbg_get_metricsverdict_priced: (a: number) => number;
|
|
827
|
+
readonly __wbg_set_metricsverdict_priced: (a: number, b: number) => void;
|
|
828
|
+
readonly __wbg_get_metricsverdict_card_id_matches: (a: number) => number;
|
|
829
|
+
readonly __wbg_set_metricsverdict_card_id_matches: (a: number, b: number) => void;
|
|
830
|
+
readonly verifyActionReceiptWithRates: (a: number, b: number, c: number, d: number) => number;
|
|
831
|
+
readonly __wbg_cloudtrailfeedverdict_free: (a: number, b: number) => void;
|
|
832
|
+
readonly __wbg_get_cloudtrailfeedverdict_feed_complete: (a: number) => number;
|
|
833
|
+
readonly __wbg_set_cloudtrailfeedverdict_feed_complete: (a: number, b: number) => void;
|
|
834
|
+
readonly __wbg_get_cloudtrailfeedverdict_kind: (a: number, b: number) => void;
|
|
835
|
+
readonly __wbg_set_cloudtrailfeedverdict_kind: (a: number, b: number, c: number) => void;
|
|
836
|
+
readonly __wbg_get_cloudtrailfeedverdict_digests_verified: (a: number) => number;
|
|
837
|
+
readonly __wbg_set_cloudtrailfeedverdict_digests_verified: (a: number, b: number) => void;
|
|
838
|
+
readonly __wbg_get_cloudtrailfeedverdict_window_end: (a: number, b: number) => void;
|
|
839
|
+
readonly __wbg_set_cloudtrailfeedverdict_window_end: (a: number, b: number, c: number) => void;
|
|
840
|
+
readonly __wbg_get_cloudtrailfeedverdict_window_start: (a: number, b: number) => void;
|
|
841
|
+
readonly __wbg_set_cloudtrailfeedverdict_window_start: (a: number, b: number, c: number) => void;
|
|
842
|
+
readonly __wbg_get_cloudtrailfeedverdict_signed_log_files_count: (a: number) => number;
|
|
843
|
+
readonly __wbg_set_cloudtrailfeedverdict_signed_log_files_count: (a: number, b: number) => void;
|
|
844
|
+
readonly __wbg_get_cloudtrailfeedverdict_signed_log_files_json: (a: number, b: number) => void;
|
|
845
|
+
readonly __wbg_set_cloudtrailfeedverdict_signed_log_files_json: (a: number, b: number, c: number) => void;
|
|
846
|
+
readonly verifyCloudTrailFeed: (a: number, b: number, c: number) => void;
|
|
402
847
|
readonly __wbg_set_approvaltokenclaims_decision: (a: number, b: number, c: number) => void;
|
|
403
848
|
readonly __wbg_set_approvaltokenclaims_scope: (a: number, b: number, c: number) => void;
|
|
404
849
|
readonly __wbg_set_verifieddelegation_sub: (a: number, b: number, c: number) => void;
|
|
405
850
|
readonly __wbg_set_verifieddelegation_scope: (a: number, b: number, c: number) => void;
|
|
406
|
-
readonly
|
|
407
|
-
readonly
|
|
408
|
-
readonly
|
|
409
|
-
readonly
|
|
410
|
-
readonly
|
|
411
|
-
readonly
|
|
851
|
+
readonly __wbg_set_commitmentverdict_verdict: (a: number, b: number, c: number) => void;
|
|
852
|
+
readonly __wbg_set_commitmentverdict_signer_fpr: (a: number, b: number, c: number) => void;
|
|
853
|
+
readonly __wbg_set_cloudtrailfeedverdict_broken_at: (a: number, b: number) => void;
|
|
854
|
+
readonly __wbg_get_cloudtrailfeedverdict_broken_at: (a: number) => number;
|
|
855
|
+
readonly __wbg_commitmentverdict_free: (a: number, b: number) => void;
|
|
856
|
+
readonly __wbg_get_approvaltokenclaims_decision: (a: number, b: number) => void;
|
|
857
|
+
readonly __wbg_get_approvaltokenclaims_scope: (a: number, b: number) => void;
|
|
858
|
+
readonly __wbg_get_verifieddelegation_sub: (a: number, b: number) => void;
|
|
859
|
+
readonly __wbg_get_verifieddelegation_scope: (a: number, b: number) => void;
|
|
860
|
+
readonly __wbg_get_commitmentverdict_verdict: (a: number, b: number) => void;
|
|
861
|
+
readonly __wbg_get_commitmentverdict_signer_fpr: (a: number, b: number) => void;
|
|
862
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
863
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
864
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
865
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
412
866
|
}
|
|
413
867
|
|
|
414
868
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|