Documentation

CslibFrontier.Crypto.Computational.HQC.DQCSD

Native quantum HQC syndrome-decoding assumptions #

The finite laws are exactly the parity-constrained distributions already formalized from [GAMA+26], Definitions 2.3.6--2.3.9, pp. 12--13. This module gives their tuples canonical fixed-width word encodings and states that the real and comparison word ensembles are indistinguishable to the native quantum tests of Cslib.Crypto.NativeQuantum.

For 2-DQCSD-P, a word contains the public circulant generator followed by the syndrome. Its length is 2 * n. For 3-DQCSD-PT, a word contains both public generators, the complete first syndrome and the retained prefix of the second syndrome. If the source truncates ell final coordinates, its length is 3 * n + (n - ell). DQCSDParameters enforces positive block length and weight with weight <= n; DQCSDTruncatedParameters additionally enforces 0 < ell < n, as in the source problem family.

The source asks whether its samples came from the structured or comparison distribution with non-negligible advantage. It does not define this repository's exact generated gate family, initial state or measurement convention. NativeQuantumTwoDQCSDP and NativeQuantumThreeDQCSDPT therefore state the source problems over the exact source distributions against a narrower class of adversaries, the native quantum tests, which makes them no stronger than the source's. They are assumptions, not hardness theorems. Primitive-prime admissibility, efficient sampling, public-seed expansion, QROM simulation, decoding failures and HQC-PKE/KEM reductions remain separate obligations.

Main definitions #

Main results #

References #

Positive block-length and fixed-weight schedules from the source DQCSD problem families.

  • blockLength : ℕ → ℕ

    Ambient quasi-cyclic block length.

  • weight : ℕ → ℕ

    Hamming weight of every secret block.

  • blockLength_pos (κ : ℕ) : 0 < self.blockLength κ

    Source problem instances have positive block length.

  • weight_pos (κ : ℕ) : 0 < self.weight κ

    Source problem instances have positive secret weight.

  • weight_le (κ : ℕ) : self.weight κ ≤ self.blockLength κ

    A fixed-weight block fits in its ambient block.

Source 3-DQCSD-PT parameters, where truncation final positions are removed.

Serialize the public circulant generator followed by the complete syndrome.

@[simp]

The two-block encoding contains exactly two ambient blocks.

The fixed-width two-block encoding preserves the complete source tuple.

Serialize both public generators, the complete first syndrome and the retained prefix of the second syndrome, in that order.

@[simp]

The truncated three-block encoding contains three ambient blocks and the retained prefix.

The fixed-width truncated encoding preserves all four components of the source tuple.

Exact encoded length of a 2-DQCSD-P sample.

Exact encoded length of a 3-DQCSD-PT sample after truncating ell final coordinates.

noncomputable def Cslib.Crypto.HQC.twoRealEnsemble (params : DQCSDParameters) (publicParity : ℕ → Bool) (κ : ℕ) :

Encoded 2-QCSD-P real ensemble from Definition 2.3.6.

noncomputable def Cslib.Crypto.HQC.twoUniformEnsemble (params : DQCSDParameters) (publicParity : ℕ → Bool) (κ : ℕ) :

Encoded 2-DQCSD-P comparison ensemble from Definition 2.3.7. The syndrome parity is the derived value weight + publicParity * weight mod 2.

noncomputable def Cslib.Crypto.HQC.threeRealEnsemble (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) (κ : ℕ) :

Encoded 3-QCSD-PT real ensemble from Definition 2.3.8. The retained second component is the prefix of length n - ell, and both syndromes use the same third secret block.

noncomputable def Cslib.Crypto.HQC.threeUniformEnsemble (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) (κ : ℕ) :

Encoded 3-DQCSD-PT comparison ensemble from Definition 2.3.9. The first syndrome keeps its derived parity, while the retained second component is independent and uniform.

Every encoded real 2-QCSD-P sample has the exact declared word length.

Every encoded comparison 2-DQCSD-P sample has the exact declared word length.

theorem Cslib.Crypto.HQC.supportsLength_threeRealEnsemble (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) :
NativeQuantum.SupportsLength (threeRealEnsemble params firstParity secondParity) (threeWordLength params)

Every encoded real 3-QCSD-PT sample has the exact declared word length.

theorem Cslib.Crypto.HQC.supportsLength_threeUniformEnsemble (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) :
NativeQuantum.SupportsLength (threeUniformEnsemble params firstParity secondParity) (threeWordLength params)

Every encoded comparison 3-DQCSD-PT sample has the exact declared word length.

Concrete native quantum 2-DQCSD-P security with exact sample lengths and separate circuit resource budgets: at each κ, every native quantum test within a budget has advantage at most ε of κ and that budget. This is the concrete form of NativeQuantumTwoDQCSDP; the problem is 2-DQCSD-P of [GAMA+26], Definition 2.3.7, pp. 12–13, which asks only for non-negligible advantage and has no concrete form, so ε and the budgets are the caller's.

The source-named concrete two-block assumption is exactly the shared native quantum indistinguishability interface.

Native quantum 2-DQCSD-P hardness for the exact source distributions. This is an assumption under the repository's no-advice, no-useful-oracle native test convention.

Source. This is the 2-DQCSD-P problem of [GAMA+26] (version 5.1, November 9, 2026), Definition 2.3.7, pp. 12–13: decide with non-negligible advantage whether (H, y) came from the 2-QCSD-P distribution of Definition 2.3.6, p. 12, or from the uniform distribution on F^{n×2n}_{2,b₁} × F^n_{2,b₂}. There H = (I_n rot(h)) with h of parity b₁, the real y is H x⊤ for x = (x₁, x₂) with both halves of weight ω, and b₂ = ω + b₁ ω mod 2. Here n, ω and b₁ are params.blockLength κ, params.weight κ and publicParity κ, and a sample is the word of h followed by y. This definition differs from the source as follows.

  • The adversaries are the native uniform quantum tests of NativeQuantum, without advice or a useful oracle; the source fixes no model of computation, so this class is narrower.
  • The parameters are any schedule in κ with positive block length and weight; the specification takes n to be a primitive prime (p. 13) and fixes its parameter sets.

The source-named asymptotic two-block assumption is exactly the shared native quantum computational-indistinguishability interface.

theorem Cslib.Crypto.HQC.NativeQuantumTwoDQCSDP.of_within {params : DQCSDParameters} {publicParity : ℕ → Bool} {ε : ℕ → Quantum.OracleCircuit.Resources → NNReal} (h : NativeQuantumTwoDQCSDPWithin params publicParity ε) (hn : PolynomiallyBounded params.blockLength) (hneg : ∀ (qubits gates queries descriptionBits : ℕ → ℕ), PolynomiallyBounded qubits → PolynomiallyBounded gates → PolynomiallyBounded queries → PolynomiallyBounded descriptionBits → Negligible fun (κ : ℕ) => ε κ { qubits := qubits κ, gates := gates κ, queries := queries κ, descriptionBits := descriptionBits κ }) :
NativeQuantumTwoDQCSDP params publicParity

A concrete bound negligible along every polynomial circuit-resource schedule implies native quantum 2-DQCSD-P hardness when the ambient block length is polynomially bounded.

Concrete native quantum 3-DQCSD-PT security with exact sample lengths and separate circuit resource budgets: at each κ, every native quantum test within a budget has advantage at most ε of κ and that budget. This is the concrete form of NativeQuantumThreeDQCSDPT; the problem is 3-DQCSD-PT of [GAMA+26], Definition 2.3.9, p. 13, which asks only for non-negligible advantage and has no concrete form, so ε and the budgets are the caller's.

theorem Cslib.Crypto.HQC.nativeQuantumThreeDQCSDPTWithin_iff_indistinguishableWithin (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) (ε : ℕ → Quantum.OracleCircuit.Resources → NNReal) :
NativeQuantumThreeDQCSDPTWithin params firstParity secondParity ε ↔ NativeQuantum.IndistinguishableWithin (threeRealEnsemble params firstParity secondParity) (threeUniformEnsemble params firstParity secondParity) (threeWordLength params) ε

The source-named concrete truncated three-block assumption is exactly the shared native quantum indistinguishability interface.

def Cslib.Crypto.HQC.NativeQuantumThreeDQCSDPT (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) :

Native quantum 3-DQCSD-PT hardness for the exact source distributions. This is an assumption under the repository's no-advice, no-useful-oracle native test convention.

Source. This is the 3-DQCSD-PT problem of [GAMA+26] (version 5.1, November 9, 2026), Definition 2.3.9, p. 13: decide with non-negligible advantage whether (H, (y₁, y₂)) came from the 3-QCSD-PT distribution of Definition 2.3.8, p. 13, or from the uniform distribution on F^{2n×3n}_{2,b₁,b₂} × (F^n_{2,b₃} × F^{n-ℓ}_2). There H has the blocks rot(h₁) and rot(h₂) with hᵢ of parity bᵢ, the real (y₁, y₂) is H x⊤ for x = (x₁, x₂, x₃) with all three blocks of weight ω, its second half truncated to its first n - ℓ coordinates, and b₃ = ω + b₁ ω mod 2. Here b₁, b₂ and ℓ are firstParity κ, secondParity κ and params.truncation κ, and a sample is the word of h₁, h₂, y₁ and the truncated y₂. This definition differs from the source as NativeQuantumTwoDQCSDP does: native quantum tests, and any parameter schedule (here with 0 < ℓ < n) in place of the specification's primitive prime n and fixed parameter sets.

theorem Cslib.Crypto.HQC.nativeQuantumThreeDQCSDPT_iff_computationallyIndistinguishable (params : DQCSDTruncatedParameters) (firstParity secondParity : ℕ → Bool) :
NativeQuantumThreeDQCSDPT params firstParity secondParity ↔ NativeQuantum.ComputationallyIndistinguishable (threeRealEnsemble params firstParity secondParity) (threeUniformEnsemble params firstParity secondParity)

The source-named asymptotic truncated three-block assumption is exactly the shared native quantum computational-indistinguishability interface.

theorem Cslib.Crypto.HQC.NativeQuantumThreeDQCSDPT.of_within {params : DQCSDTruncatedParameters} {firstParity secondParity : ℕ → Bool} {ε : ℕ → Quantum.OracleCircuit.Resources → NNReal} (h : NativeQuantumThreeDQCSDPTWithin params firstParity secondParity ε) (hn : PolynomiallyBounded params.blockLength) (hneg : ∀ (qubits gates queries descriptionBits : ℕ → ℕ), PolynomiallyBounded qubits → PolynomiallyBounded gates → PolynomiallyBounded queries → PolynomiallyBounded descriptionBits → Negligible fun (κ : ℕ) => ε κ { qubits := qubits κ, gates := gates κ, queries := queries κ, descriptionBits := descriptionBits κ }) :
NativeQuantumThreeDQCSDPT params firstParity secondParity

A concrete bound negligible along every polynomial circuit-resource schedule implies native quantum 3-DQCSD-PT hardness when the ambient block length is polynomially bounded.