Repository navigation
Release 0.2.0: merge every development branch, with changelog and version bump - #17
Merged
Merged
Conversation
…d completion signals Runs record when they start and end; a 429 puts the run in a retrying state that resubmits after Retry-After (or a doubling wait) up to five times, and Stop cancels it. Check supersedes a running check of earlier inputs. Auto-check is a pure decision plus a debounced driver: it waits 1.2 s after the last edit, never runs on invalid inputs or during an experiment, respects the service queue and stops a superseded auto-check before submitting the next. Settings and recent durations are saved in this browser.
… not checked The result area shows the lib/preview.ts diagnostics for the inputs in the editor before any run, while a check runs and above results from an earlier version, under 'Preview (not yet checked by Lean)'. A Lean result for exactly these inputs replaces it.
… card into the workbench
…rtcuts and the width selector
The popover focused its first input, which is disabled when notifications are blocked, so focus stayed outside it and the window handler read Escape as Stop. The popover is now an overlay in the store, focuses the first enabled control, closes on Escape from the button or panel and on tabbing out, and the window key handler (moved to state/keys.ts) leaves Escape to any open overlay.
On Experiments it stops the experiment before any check, in the story the story's runs; the announcement and the palette command name the job.
The error, the progress line and the README now all count attempts in all (six: the first and five retries).
A busy service that never took the run, an unreachable service, a rejected request or a stop before the job started now show their error (with the path the service named) in the execution banner, say that nothing was checked, and keep the instant preview below with a Check again button. The progress line keeps only errors of runs still under way.
… by Lean' Only a completed run labels the strip 'Checked by Lean'. After a time-out, failure or stop the strip names that outcome, shows Lean's status only for claims it decided, and keeps the preview for claims left not established because the run ended.
…eck matched A look-up that found no recording (replay, or the service offline) now reads 'No recorded check for these inputs; start the service to check them.'
The card says which results are recorded Lean runs and which are an unchecked browser preview. The header badge drops its Retry wherever the card shows its own Try now, and uses the same label in the story.
… last resort Typing 'stop' no longer lists the story steps and a preset under the Stop command: a letters-in-order match must stay inside one label word that starts with the same letter, and is offered only when nothing matches better.
A failure, a time-out or a rejected input is not something the user stopped: the title now reads ✕ Failed, ✕ Timed out, ✕ Stopped or ✕ Rejected, and the Alerts popover and README say so.
The Experiments view showed the running experiment twice, compact in the action bar and in full in the panel below, each with its own live status region and Stop button; the workspace result area and the first story step did the same for their runs. The compact RunProgress beside the run buttons is now the single status region and Stop control, and the panels use RunDetails, which shows the progress bar, the steps and the busy-retry explanation with no live region and no buttons.
The polite announcement region lived in the workspace view, so 'Stopping the experiment.' after Escape on Experiments, and other announcements made outside the workspace, were never read out. It is now mounted once by App.
A quick experiment started from the workspace that failed before any report (busy service, unreachable service, rejected request) left no trace in the workspace. The run bar now keeps the status of the latest check or experiment that ended without a report, in the same live region that showed it running, with a link to Experiments or Jump to results.
A recorded or cached report of a timed-out or failed run, fetched by a run that itself completed, made the strip read 'Checked by Lean'. The strip now takes the outcome from the report's execution state when it has one.
The auto-check status read 'Up to date.' whenever the latest check of these inputs had completed, including a completed fetch of a recorded or cached report whose own execution timed out or failed. Such a check now counts as not finished, as in the instant-checks strip.
The page can only observe that the service does not answer (it may be starting, or listening elsewhere), not that it is not running.
Typing a single letter matched every command whose label, group or keywords contained it anywhere. One letter now matches only the start of a word; label substrings need two letters and keyword substrings three.
…lette matching in the web README
The run bar holding the Stop button is at the top of the workspace, well above the result area; the panel's caption now says so.
A refused or unreachable submission read 'took 0.0 s' next to Failed. A run that ended without a job id did no work and now shows no duration.
The prime-field, S-box certificate and HADES activity claims also get SARIF rules and locations after the merges; docs/ci.md now names all 16 claim ids and the pointers claimLocation gives the newer claims.
…the profile tables The prime-field profile tables were written before the S-box certificates landed; AES-like reports carry sbox.differential and sbox.linearity.
…laims The recorded examples predate the merged branches: the capabilities example now lists hades/prime/v1, and the completed AES job (and the docs/api.md sample) carries sbox.differential and sbox.linearity after activity.bound, with seven emitted and accepted theorems.
Conflicts resolved as the union of both sides: - report.rs, types.ts, witness schema test, format.ts, web witness.ts: the S-box differential/linearity witnesses and the kernel witness - verify.ts: RECHECKED gains external.m4_mds and external.invertible next to the S-box quality claims; the ADDED_LATER groups are kept (no bundle recorded before the wide claims can have a width above 4) - web: the S-box quality preview with the wide-width preview, the report export with the width-aware claim list, the paste-aware matrix editor inside the scroll box for wide matrices - README, evidence-model, research-directions: both claim sets in the tables and timings Wiring of the wide claims into the registries unified earlier: - everyDesignClaimFor(model) lists the claims of every width, used by KNOWN_CLAIM_IDS and the SARIF rule titles - SARIF locations of external.m4_mds and external.invertible point at the external matrix; docs/ci.md lists the rules and locations - project-config.schema.json claims enum gains both ids - the HTML report summarizes and shows the kernel witness
Conflicts resolved as the union of both sides: - report.rs, types.ts, witness/claim schemas, format.ts, web witness views: the kernel, S-box quality and constant-mismatch witnesses and the constants.grain claim id - diagnostics.rs: diagnose_hades takes the modulus for the Grain comparison, and the prime-field path keeps the packed analysis and the wide claims - cli.ts: the import command moves into cli-main.ts (the CLI was split into cli.ts and cli-main.ts), with the io working directory and streams - verify.ts: one ADDED_LATER list with per-group evidence; the constants.grain group is decided by the checker revision on its own, the S-box quality group by the certificate digest; RECHECKED has the S-box quality, wide-width and Grain claims - core and CLI tests, integration tests: both test sets; the wide-width expectations gain constants.grain (not established without constants) and the CLI snapshots of the wide examples are regenerated - README, server README, adopter guide, architecture, evidence model, research directions: both claim sets in every table Wiring of constants.grain and constant-mismatch into the registries: - SARIF location: the differing constant when refuted, else constants - HTML report witness summary and block for constant-mismatch - project-config.schema.json claims enum; init defaults (reference constants of the BN254 preset) and its test - docs/ci.md rule list and location table Grain constants are checked at the wide widths too: Plonky3 KoalaBear width-16 constants imported into koalabear-t16.json are proved in Lean (5.8 s), so the docs no longer say wide widths cannot be checked.
Conflicts resolved as the union of both sides: - ResultsPanel: the live preview, run details and checkNow of the automation branch, with the model-keyed and width-aware claim lists, the HTML report export and the prime-field display field - DesignEditor: the AES-like width switch next to the prime-field and width picker with the Plonky3 presets; the Plonky3 hint says how round constants are added for constants.grain - ExperimentsView: run details, service card and budget, with the report export button - WorkspaceView: one title for the quick-experiment button (the prime-field explanation or the shortcut) - README: the prime-field inputs, the live checks and shortcuts, and the S-box quality claims in the usage steps Follow-ups for the merged features: - the command palette and Ctrl/Cmd+Shift+Enter do not start experiments for prime-field designs, as the workspace button already did not - the instant-check strip has short labels for the S-box quality, primality and wide external claims; its tests count the S-box quality previews and keep them for reports recorded before those claims
A refuted native.correctness claim was labelled 'Generated Rust passed N correctness cases' with N the passing cases, which reads like a pass in text, Markdown and HTML reports. Fresh reports now say 'Generated Rust failed F of N correctness cases'; the claim schema and isEvidenceLabel accept both, so recorded bundles keep their label.
… unsupported for BN254 circuits
…ablished under a CI policy
… wide Plonky3 instances
…t status and constant counts
…to the evidence model, define unsupported by its one use and list the Recorded run badge
…ificates, width 2 included
…t report in the web README
…he client declares 3.9
Resolve the overlap with the branches merged before it, as in the release/v0.2.0 integration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integration branch: merges every PR listed below with conflicts resolved, plus the fixes from the full verification run, version 0.2.0 and the changelog. Merge either this PR alone, or the individual PRs in order and then close this one.
How to apply
This branch merges all 16 development branches (each listed below on this page) with their conflicts resolved, then adds fixes found by a full verification run, version 0.2.0 and CHANGELOG.md. Apply it as one change:
To keep the individual commits instead, push the feature branches below and merge them in the order of the release branch's merge commits.
Verification on the final commit
Not verified here
Every package carries version 0.2.0: the Rust workspace crates,
@cryptificate/schema, the server,the web workbench, the Python client, both Lean packages (
lean/,refinement/) and the OpenAPIdescription.
cryptificate --versionprintscryptificate 0.2.0 (<revision>), and the enginecryptificate-engine 0.2.0.Every new Lean theorem below has its axioms pinned with
#guard_msgsto a subset ofpropext,Classical.choiceandQuot.sound. Nothing usessorry, a new axiom,native_decideorbv_decide.Added
Proofs from the Rust source (refinement package, Lean v4.35.0, Charon 0.1.294, Aeneas 74aabd5)
aes_rust_activity_bound(with_exists,_10and_4): for the AES MixColumns matrix, ShiftRows offsets[0, 1, 2, 3]and the FIPS 197S-box table, given as byte arrays, any two different input states and any round keys (at least
r), both executions of the Aeneas model ofaes_like::encryptreturn normally and have atleast
activityBound ractive S-boxes: at least 55 over 10 rounds and 25 over 4. There is nodesign hypothesis; the design checks are evaluated by the Lean kernel (
decide +kernel).aes_like_encrypt_activity_bound_of_checks: for any bytearrays
m,o,t, the same bound holds whenever three Boolean checks on the bytes pass(
minors4Ok (matrixOf m),offsetsDistinct o,tableCovers t), each closable bydecide +kernelfor fixed bytes.sboxOf_injective_iffshows that an injective S-box is exactlya table without repeated entries.
aes_like::final_roundandaes_like::encrypt_with_last_round(no MixColumns in the last round, then a final key), with theFIPS 197 AES-128 known-answer vectors in the Rust tests. Lean model
aesLikeFinalRoundandaesLikeCipher, withaesLikeCipherActiveSboxes_bound: the bound overrrounds of the cipher,final round included, equals the bound of the first
rrounds of the original model.Refinement:
aes_like_final_round_refines,aes_like_encrypt_with_last_round_refines(givenmore than
roundskeys), the activity bound under the three design hypotheses and under thethree byte checks, and
aes_rust_cipher_activity_bound_10: at least 55 active S-boxes over theten rounds of the AES-128 data path for the AES byte arrays and any eleven or more keys, with no
design hypothesis. A main-package example evaluates the model on FIPS 197 Appendix B and proves
that it yields the standard's ciphertext.
crates/kernels/src/bn254_mont.rs(mulby CIOS,add,sub,to_mont,from_monton four 64-bit limbs) is extracted and proved against WideTrail'sPoseidon2.BN254.F = ZMod p: on canonical inputs (formul, the first operand) the functions donot panic and return the canonical result of
a·b·R⁻¹,a + banda − bmodp;to_montandfrom_montcomputex·Randx·R⁻¹modpfor any input. Rust tests compare thekernel with
ark_bn254::Frlimb for limb.refinement/claims.jsonrecords 40 theorems in six kernels (gf256,aes-like,aes-like-checked,aes-like-aes,gf256-crate,bn254-mont). Theorems about the AES bytes arerecorded under a kernel whose
appliesTonames the AES design, andclaims.pyrefuses to recordthem elsewhere.
Design claims (Lean-checked certificates, main package, Lean v4.33.1)
activity.partialandactivity.total.activity.partialis proved by an observability certificate (everyLconsecutive partialrounds activate an S-box, for any round constants, with
Lat most the number of partial rounds)or refuted by a
partial-bypasswitness: a nonzero difference that reaches no partial-round S-boxin any partial round.
activity.totaladds one active S-box per disjoint window ofLpartialrounds to the full-round bound. For the pinned Poseidon2 BN254 instance (width 3, 8 full and 56
partial rounds,
L = 3) this proves at least 16 + ⌊56/3⌋ = 34 active S-boxes over all 64 rounds.The example
poseidon2-bypass.json(the external matrix reused as internal matrix) is refutedwith the bypass
[0, 1, -1].hades/prime/v1: HADES/Poseidon2 designs over BabyBear, KoalaBear,Mersenne31, Goldilocks or a custom prime below 2⁶⁴. New claim
field.prime: the engine computes aPratt certificate for the modulus and Lean checks it by kernel evaluation
(
Pratt.prime_of_checkFlat); the activity bounds require it. The modulus is echoed in everycertificate and bound to the request. The same checker proves the four named primes and, as a
cross-check, the BN254 modulus.
design claims are those of BN254 (branch number width + 1; width 2 through
Mat2.isMDS_of_minorsOk). Above width 4 the engine computes witnesses modulopand the kernelchecks them, each vector packed into one numeral so that a dot product is one big-number product
(
Packed.kron_eq): inverse matrices forinternal.invertibleand the newexternal.invertible,the inverse of the observability rows for
activity.partial(windowL = t), orthogonality tothose rows for a bypass, a low-weight vector that refutes
external.mds, and the new claimexternal.m4_mds(the external matrix iscirc(2 M₄, M₄, …, M₄)withM₄MDS; this does notclaim that the full matrix is MDS). A refuted invertibility claim now carries a nonzero kernel
vector as its witness (kind
kernel, at every width and in the BN254 profile).examples: BabyBear, KoalaBear and Mersenne31 at widths 16 and 24, Goldilocks at widths 8 and 12
(Plonky3 commit
0d803737). Lean proves both matrices invertible andM₄MDS and refutes the MDSproperty of the full external matrix. KoalaBear-16 and Goldilocks-8/12 charge every window of
tpartial rounds. BabyBear-16/24, Mersenne31-16/24 and KoalaBear-24 have fewer partial roundsthan their width, so
activity.partialis refuted for them: a statement about differencesthrough the partial rounds alone, which says nothing about the full rounds.
constants.grain(BN254 and prime-field profiles): thekernel runs a transcription of the Poseidon2 reference procedure (Grain LFSR,
poseidon2_rust_params.sageof HorizenLabs/poseidon2 at commit055bde3) for the design'smodulus, width and round numbers and compares the result with the submitted constants; otherwise
it proves the generated value at one differing position (
constant-mismatchwitness, the firstdifference as located by the engine). WideTrail's pinned BN254 constants are proved to be the
Grain constants for
t = 3,R_F = 8,R_P = 56, and Plonky3's KoalaBear width-16 constantsare proved to be Grain constants. The claim is about provenance, not the quality of the constants.
cryptificate import FILE --base DESIGN.jsonreads round constants from Plonky3 split arrays,HorizenLabs poseidon2 instances or printed lists, JSON or CSV into a copy of a design, in the
Poseidon2 layout.
sbox.differentialandsbox.linearity: the exact differentialuniformity and the exact linearity (largest absolute Walsh coefficient) of a submitted byte S-box
table, each with a pair of bytes attaining it, checked with
decide +kernelonly. The AES values,4 and 32 (nonlinearity 112), are proved once in the library. These are value claims:
provedornot_established, neverrefuted.Tooling
checkandverifytake several files or patterns,--fail-on none|refuted|not-established|any,--claims ID,...,--format text|json|sarif|junit|markdown|htmland--output, and append a Markdown summary toGITHUB_STEP_SUMMARY;check --bundle-dirwrites one bundle per input. Exit status 0 passes,1 is a policy failure or a
verifymismatch, 2 is an error. A newreportcommand renders savedresults, reports and bundles without running the engine or Lean. A composite GitHub Action
(
action.yml) builds the toolchain with caching, gates the job, uploads SARIF to code scanning(each result points at the design file, at the offending element where possible) and uploads the
results, JUnit, HTML and bundles. See docs/ci.md.
restrictive Content-Security-Policy, the same bytes for the same report) from one renderer:
--format html,report.htmlin every new bundle,GET /api/jobs/{id}/report.html,Client.report_htmlin Python and the workbench's Export report button. It shows the inputs,every claim with its statement, axioms and witness, and the provenance.
cryptificate initscaffoldscryptificate.json, a design (presetsaes,aes-row-scaled,poseidon2-bn254, optionally with a circuit) and a GitHub workflow;cryptificate doctorchecks Node.js, elan, the pinned toolchain, Mathlib, the Lean build, the engine, rustc, the state
directory, disk space and the service, and prints a fix for each problem.
checkwithoutarguments reads its inputs, policy and claim scope from the nearest
cryptificate.json(
--config FILEnames one; schemaschemas/project-config.schema.json), and so does the actionwhen its
inputsis empty.--uri-base DIRsets the base of SARIF locations.schemas/openapi.jsondescribes the HTTP API (OpenAPI 3.1, seven operations, everyerror response, examples recorded from a live service); the service serves it self-contained at
GET /api/openapi.json, and docs/api.md documents the API with curl examples. Newschemas/error.schema.json. The Python client has one method per operation (Client.openapi(),OPERATIONS,CryptificateError.retry_after,python -m cryptificate job|stop|openapi).@cryptificate/schemagains a dependency-free JSON Schema validator that fails on keywords itdoes not implement.
Dockerfilewith the pinned Lean toolchain, the built Leanlibrary and Mathlib, the release engine, the Rust toolchain for native experiments, the service
and the workbench; it runs as uid 1000 under
tiniwith a health check. Thedockerworkflowbuilds it, runs
scripts/docker-smoke.pyinside it and publishes the tested image toghcr.io/4waan/cryptificateonv*tags.servetakes its bind address from--hostorCRYPTIFICATE_HOST(loopback by default). See docs/docker.md.note), including the prime-field and Plonky3 presets; a prime-field profile editor with a field
picker, a custom modulus and a width picker.
and Copy as JSON, C, Rust, Sage or a plain grid.
replace, and share links that carry the design and circuit in the URL.
computes against the target.
report for the same inputs; an opt-in auto-check 1.2 s after editing stops, which backs off
when the service is busy; job progress with elapsed time, an estimate and the service budget,
and optional notifications.
?) and a Ctrl/Cmd+K command palette.npm startand automatic reconnection.Changed
checkexits 2, not 1, when a run fails or times out, and on an uncaught internal error.Without a policy (
--fail-on, orfailOnincryptificate.json, which defaults torefuted) acompleted
checkstill exits 0.witness kinds.
verifylists a claim that a bundle recorded before the claim existed asnot recordedinstead of failing (see docs/adopter-guide.md); for thetwo S-box value claims it compares the value and the witness, not only the status.
rust.refinementfrom the current refinement status instead ofcopying it from the cached run. In the container (
CRYPTIFICATE_CONTAINER=1)rust.refinementis never
proved.arkworks'
Fr, which no proof covers); the status is stillunsupported.answers 404 "no such endpoint" for GET and POST and 405 for other methods; a bundle request for a
job that ended without a report answers 409 "the job ended before it produced a report"; a
400 invalid-requestresponse setserror.pathto the first problem's JSON Pointer.job.schema.jsongains the job summary and envelope definitions.Fixed
native.correctnessclaim was labelled "Generated Rust passed N correctness cases"with N the passing cases, which reads like a pass. Fresh reports say "Generated Rust failed F of
N correctness cases"; recorded bundles keep their label, and the schema accepts both.
proof-cache change above).
docs/batch-interface.mddescribes theinconclusivetiming verdict by the harness's rule, notas overlapping intervals or too few samples.
command_line_handlingno longer fails at random when the engine exits beforereading its input.
Known limitations
ark_bn254::Fr, which the pinnedAeneas cannot translate, so the timed BN254 arithmetic is not the proved
bn254_montkernel andrust.refinementreadsunsupportedfor BN254 circuits. Equality of the kernel's limbs witharkworks' is tested, not proved, and no Rust HADES or Poseidon2 round over BN254 is extracted
(
notEstablishedinrefinement/claims.json).library, rustc and the hardware are trusted), not about compiled code. The AES key expansion is
not modelled; the theorems hold for every key sequence. The analysis service does not yet run the
_of_checkstheorems for submitted designs, andrust.refinementcovers GF(2⁸) circuits only.trail probabilities, tightness results or security levels. S-box differential uniformity and
linearity are properties of one byte table, for AES-like designs only; algebraic degree and
boomerang uniformity are not checked.
activity.outerandactivity.totalare not established (they need an MDSexternal matrix, and
circ(2 M₄, M₄, …, M₄)is not MDS), andexternal.mdsis only everrefuted. Plonky3's width-20 and width-32 instances are not offered.
activity.totalis notestablished for a design with no partial rounds.
custom moduli must be below 2⁶⁴.
constants.graintrusts the transcription of the reference script (tested against publishedconstants, a second transcription and the engine, not derived from a semantics of Sage). Poseidon
version 1, the inverse S-box and binary fields are not covered; reference constants with round
numbers other than 8 and 56, and designs without constants, are not established; a refutation
proves one differing position, not that every earlier constant agrees. The Plonky3 example
designs ship without round constants.
Lean claim.
dockerworkflow is its first build.Only
linux/amd64is built, the image is expected to exceed 10 GB, and it does not check therefinement proofs. The GitHub Action and the image workflow had not run on GitHub when 0.2.0 was
tagged.
examples/bundles,apps/web/public/recorded) and the OpenAPI exampleswere recorded before the version change and read
cryptificate 0.1.0; the bundles predate thenew claims (shown as
not recorded) andreport.html(render it withcryptificate report <bundle> --format html).not recordeddepends on the recording revisionbeing in the local git history or, for the S-box value claims, on the recorded certificate
digest; bundles are not signed.
replaces them.
Generated by Claude Code