fhe-auditor ยท diff
git:20260402.293dccc to git:20261112.cb0111b
74 added, 35 removed. Audit A to A.
What this update changes in the checks
No check changed: every fixed check gives the same answer before and after this update.
A tripped check is a label, not a verdict: read the matched text and the lines below. This week's updates that newly trip a check.
---
name: fhe-auditor
description: >
- Audit FHE implementations for noise-budget accounting, bootstrapping
- correctness, modulus-switching safety, plaintext leakage, and key-switch
- parameter integrity.
- allowed-tools:
- - Read
- - Grep
- - Glob
- - Bash
+ Audit fully homomorphic encryption code (BFV, BGV, CKKS, TFHE) for
+ noise-budget accounting, modulus and key switching, relinearization,
+ bootstrapping correctness, parameter security, decryption-result exposure
+ (IND-CPA-D), circuit privacy, threshold decryption shares, evaluation-key
+ provenance, and validation of untrusted ciphertexts. Use when reviewing an
+ FHE library, a service that evaluates on encrypted data, or any path that
+ decrypts or releases homomorphic results.
+ allowed-tools: Read Grep Glob Bash
---
# fhe-auditor
- Domain auditor for fully homomorphic encryption pipelines and transform safety.
+ Domain auditor for homomorphic encryption pipelines: every transform a
+ ciphertext passes through from encryption to the point where a decrypted
+ value, or the fact that decryption succeeded, becomes visible.
+ **Core principle:** IND-CPA covers ciphertexts only. Once a decrypted value
+ or a decryption failure is observable, the noise is an output too.
+
## When to Use
- - Auditing ciphertext lifecycle across FHE transforms
- - Reviewing noise growth calculations and claimed depth limits
- - Checking bootstrapping and key-switch correctness assumptions
- - Verifying modulus switching and plaintext/ciphertext boundary handling
+ - Auditing a BFV, BGV, CKKS, or TFHE-family library or a service built on it
+ - Reviewing noise growth calculations, claimed depth limits, modulus and
+ key switching, relinearization, bootstrapping, and plaintext/ciphertext
+ boundary handling
+ - Decrypted results or failure signals reach anyone but the key holder
+ (CKKS approximate decryption, threshold decryption, decryption services)
+ - Ciphertexts, evaluation keys, or decryption shares come from untrusted
+ parties, or the design claims circuit privacy
## When NOT to Use
- - Classical encryption reviews without homomorphic transforms
- - Parameter-level lattice audits that do not involve FHE lifecycle behavior
- - Confirming suspected FHE issues without verification gates
+ - Generic LWE/RLWE parameter estimation and sampler correctness outside the
+ FHE lifecycle -> `lattice-auditor`
+ - Non-homomorphic or hybrid encryption -> `encryption-scheme-auditor`
+ - Threshold key generation and share verification -> `dkg-threshold-auditor`
+ - The MPC protocol around threshold decryption -> `mpc-auditor`
+ - Proofs of correct encryption or decryption -> `zk-circuit-auditor`
+ - Timing and cache leakage in NTT or sampling -> `side-channel-auditor`
+ - RNG lifecycle for encryption and flooding noise -> `randomness-auditor`
+ ## Rationalizations to Reject
+
+ | Rationalization | Why it is wrong |
+ |---|---|
+ | "The scheme is IND-CPA secure, so returning decrypted results is safe" | IND-CPA gives the adversary no decryptions. A CKKS result together with its ciphertext yields linear equations in the secret key; exact schemes leak through decryption failures when the failure probability is not negligible |
+ | "The noise budget was positive in every test" | Tests sample typical inputs. The claim is a tail bound over encryption randomness for the deepest path and worst-case plaintexts, and an adversary who picks inputs or circuits aims for the tail |
+ | "The parameters come from the standard table" | The tables fix a secret distribution and bound the total modulus. Sparse secrets, special key-switching primes, and bootstrapping parameter sets are outside what the table row certifies |
+ | "Evaluation keys are public, so they need no checks" | Public is not authentic. A key-switching key from the user's key to another key is a re-encryption capability, and a mismatched key silently corrupts every result |
+ | "The server never holds the secret key, so nothing it logs is sensitive" | Plaintext operands, transparent or trivial ciphertexts, and the evaluator's own inputs are all readable without the key; result noise also carries information about the circuit |
+ | "Ciphertexts are malleable by design, so validating them is pointless" | Malleability inside the scheme is intended. A ciphertext with the wrong level, scale, degree, or coefficient range is outside it, and a decryptor that reacts to such inputs is a key-recovery oracle |
+
## Core Review Areas
- 1. Ciphertext modulus transitions and switching semantics
- 2. Noise growth tracking and budget accounting
- 3. Bootstrapping parameter validity and correctness
- 4. Plaintext/ciphertext boundary and slot-packing isolation
- 5. Key-switch material provenance and application correctness
+ 1. Scheme and parameter identification; security estimate for the full
+ modulus and the secret distribution actually used
+ 2. Ciphertext modulus transitions and switching semantics (level, scale)
+ 3. Noise growth tracking and budget accounting against the claimed depth
+ 4. Relinearization and key-switch application correctness
+ 5. Bootstrapping parameter validity and correctness
+ 6. Decryption exposure: CKKS results, observable failures, reaction attacks
+ 7. Plaintext/ciphertext boundary, slot-packing isolation, circuit privacy
+ 8. Threshold and multi-key decryption shares: smudging noise and binding
+ 9. Key-switch material provenance and validation of untrusted inputs
## Workflow
- ### Phase 1: Ciphertext lifecycle mapping
+ ### Phase 1: Scheme and lifecycle mapping
- Read `references/fhe-checklist.md`
- - Execute `workflows/noise-budget-review.md`
- - Map each ciphertext transform from encryption to final decrypt/consume step
+ - Pin the scheme, library version, and parameters; map each ciphertext
+ transform from encryption to the final decrypt or consume step
### Phase 2: Noise and transform review
- - Validate noise-budget calculations at each transform stage
- - Confirm bootstrapping refresh logic preserves security invariants
- - Verify modulus and key-switch operations do not silently degrade correctness
+ - Execute `workflows/noise-budget-review.md`: per-stage noise budget,
+ bootstrapping refresh, modulus and key-switch correctness, decryption sinks
### Phase 3: Pattern hunt
- Read `references/finding-patterns.md`
- - Prioritize exhausted noise budgets, precision drops, and leakage boundaries
+ - Prioritize exhausted noise budgets, precision drops, leakage boundaries,
+ released decryptions, and unvalidated evaluation keys
### Phase 4: Handoff
- - Send surviving findings to `crypto-fp-check`
- - Use `zkbugs-index` only after the finding survives verification
+ - Send every surviving candidate to `crypto-fp-check`; severity is assigned
+ there, not here
+ - Cross-route estimation methodology to `lattice-auditor`, flooding
+ randomness to `randomness-auditor`, threshold key generation to
+ `dkg-threshold-auditor`, scheme-paper deltas to `spec-delta-checker`
## Output Contract
- Produce an FHE-specific handoff that includes:
+ Produce an FHE handoff listing each candidate with:
- - The ciphertext lifecycle stage and transform under review
- - The measured/claimed noise budget and correctness invariant at risk
- - Whether the issue is noise, bootstrapping, modulus switch, key-switch, or leakage related
- - The next verification or reporting route
+ - `scheme_and_parameter_set`
+ - `lifecycle_stage_and_transform`
+ - `issue_class` (`noise`, `bootstrapping`, `modulus_switch`, `key_switch`,
+ `decryption_exposure`, `leakage`, or `input_validation`)
+ - `noise_or_exposure_invariant` (the budget or exposure rule at risk)
+ - `evidence` (file:line references, test or tool output)
+ - `disposition` (one of `verified`, `false_positive`, `unverified`,
+ `observation`, `residual_risk`)
+ - `next_route`
## Reference Index
- [references/fhe-checklist.md](references/fhe-checklist.md)
- [references/finding-patterns.md](references/finding-patterns.md)
+ - [references/spec-sources.md](references/spec-sources.md)
- [workflows/noise-budget-review.md](workflows/noise-budget-review.md)