Documentation

CslibFrontier.Crypto.Computational.Lattice.ShortestVector

Shortest-vector problems #

The worst-case lattice problems behind lattice-based cryptography, stated for a ℤ-submodule L of a real normed space with first minimum λ₁(L) (ZLattice.minimum) and successive minima λ_k(L) (ZLattice.successiveMinimum), following [MG02], Chapter 1:

These are predicates on a single lattice. They fix no encoding of lattices as inputs and no running-time bound, so they state what an algorithm must output, not that it is efficient.

On a discrete nonzero lattice in a proper space an exact solution of SVP_1 exists, and SVP_γ has solutions only for γ ≥ 1. Comparing the norm of an SVP_γ solution with γ · d decides GapSVP_γ on (L, d) (Cslib.Crypto.GapSVP.isCorrect_decideOfSVP), the standard reduction from the decision problem to the search problem. The first vector of a 3/4-reduced family b : Fin (n + 1) → E solves SVP_γ with γ = (√2)ⁿ on the integer span of b (Cslib.Crypto.SVP.isSolution_of_isReduced), by Proposition (1.11) of [LLL82]. By Minkowski's bound λ₁(L) ≤ √n · det(L)^{1/n}, every SVP_γ solution in EuclideanSpace ℝ ι solves HSVP_{γ√n} (Cslib.Crypto.SVP.IsSolution.hsvp).

Main definitions #

Main results #

References #

structure Cslib.Crypto.SVP.IsSolution {E : Type u_1} [NormedAddCommGroup E] (γ : ℝ) (L : Submodule ℤ E) (v : E) :

v solves search SVP_γ on L: it is a nonzero vector of L with ‖v‖ ≤ γ · λ₁(L).

  • mem : v ∈ L

    The solution is a vector of L.

  • ne_zero : v ≠ 0

    The solution is nonzero.

  • norm_le : ‖v‖ ≤ γ * ZLattice.minimum L

    The solution is within the factor γ of the first minimum: ‖v‖ ≤ γ · λ₁(L).

A YES instance (L, d) of GapSVP_γ: λ₁(L) ≤ d.

def Cslib.Crypto.GapSVP.IsNo {E : Type u_1} [NormedAddCommGroup E] (γ : ℝ) (L : Submodule ℤ E) (d : ℝ) :

A NO instance (L, d) of GapSVP_γ: γ · d < λ₁(L).

def Cslib.Crypto.GapSVP.IsCorrect {E : Type u_1} [NormedAddCommGroup E] (γ : ℝ) (L : Submodule ℤ E) (d : ℝ) (b : Bool) :

The answer b is correct for GapSVP_γ on (L, d): it accepts YES instances and rejects NO instances. Any answer is correct outside the promise.

noncomputable def Cslib.Crypto.GapSVP.decideOfSVP {E : Type u_1} [NormedAddCommGroup E] (γ d : ℝ) (v : E) :

The decision rule of the reduction from GapSVP_γ to SVP_γ: accept (L, d) when the vector v returned for L has norm at most γ · d.

theorem Cslib.Crypto.SVP.IsSolution.mono {E : Type u_1} [NormedAddCommGroup E] {γ γ' : ℝ} {L : Submodule ℤ E} {v : E} (hv : IsSolution γ L v) (hγ : γ ≤ γ') :
IsSolution γ' L v
theorem Cslib.Crypto.GapSVP.not_isYes_and_isNo {E : Type u_1} [NormedAddCommGroup E] {γ : ℝ} (hγ : 1 ≤ γ) (L : Submodule ℤ E) (d : ℝ) :
¬(IsYes L d ∧ IsNo γ L d)

For γ ≥ 1 no instance of GapSVP_γ is both a YES and a NO instance.

theorem Cslib.Crypto.GapSVP.isCorrect_decideOfSVP {E : Type u_1} [NormedAddCommGroup E] {γ : ℝ} (hγ : 0 ≤ γ) {L : Submodule ℤ E} {v : E} (hv : SVP.IsSolution γ L v) (d : ℝ) :
IsCorrect γ L d (decideOfSVP γ d v)

The reduction from GapSVP_γ to SVP_γ: for γ ≥ 0, comparing the norm of an SVP_γ solution with γ · d answers GapSVP_γ correctly on (L, d).

theorem Cslib.Crypto.SVP.exists_isSolution_one {E : Type u_1} [NormedAddCommGroup E] [ProperSpace E] {L : Submodule ℤ E} [DiscreteTopology ↥L] (hL : L ≠ ⊥) :
∃ (v : E), IsSolution 1 L v

A discrete nonzero lattice in a proper space has an exact SVP_1 solution.

theorem Cslib.Crypto.SVP.IsSolution.one_le {E : Type u_1} [NormedAddCommGroup E] [ProperSpace E] {γ : ℝ} {L : Submodule ℤ E} [DiscreteTopology ↥L] {v : E} (hv : IsSolution γ L v) :
1 ≤ γ

On a discrete lattice, SVP_γ has solutions only for γ ≥ 1.

@[reducible, inline]
noncomputable abbrev Cslib.Crypto.SIVP.IsSolution {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] (γ : ℝ) (L : Submodule ℤ E) (v : Fin (Module.finrank ℤ ↥L) → E) :

v solves SIVP_γ on L: the φ(L) = λ_n(L) (ZLattice.successiveMinimum L (finrank ℤ L)) specialization of GIVP.IsSolution, asking for n = rank L linearly independent vectors of L, each of norm at most γ · λ_n(L).

theorem Cslib.Crypto.SIVP.IsSolution.mono {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {γ γ' : ℝ} {L : Submodule ℤ E} {v : Fin (Module.finrank ℤ ↥L) → E} (hv : IsSolution γ L v) (hγ : γ ≤ γ') :
IsSolution γ' L v

Enlarging the approximation factor γ preserves SIVP_γ solutions.

On a full-rank discrete lattice of positive dimension n in a finite-dimensional space, SIVP_γ has solutions only for γ ≥ 1.

theorem Cslib.Crypto.SVP.isSolution_of_isReduced {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {n : ℕ} {b : Fin (n + 1) → E} (hb : Algorithms.LatticeReduction.IsReduced (3 / 4) b) (hb0 : b 0 ≠ 0) :

The first vector of a 3/4-reduced family b : Fin (n + 1) → E with b₀ ≠ 0 solves SVP_γ with γ = (√2)ⁿ on the integer span of b ([LLL82], Proposition (1.11)).

structure Cslib.Crypto.HSVP.IsSolution {ι : Type u_1} [Fintype ι] (γ : ℝ) (L : Submodule ℤ (EuclideanSpace ℝ ι)) (v : EuclideanSpace ℝ ι) :

v solves Hermite HSVP_γ on a lattice L in EuclideanSpace ℝ ι, n = |ι|: it is a nonzero vector of L with ‖v‖ ≤ γ · det(L)^{1/n}. The predicate carries no full-rank or discreteness assumption, and covolume L has its meaning as the lattice determinant only for full-rank discrete lattices ([DiscreteTopology L] [IsZLattice ℝ L]), which is where the predicate should be read.

theorem Cslib.Crypto.SVP.IsSolution.hsvp {ι : Type u_1} [Fintype ι] [Nonempty ι] {γ : ℝ} (hγ : 0 ≤ γ) {L : Submodule ℤ (EuclideanSpace ℝ ι)} [DiscreteTopology ↥L] [IsZLattice ℝ L] {v : EuclideanSpace ℝ ι} (hv : IsSolution γ L v) :

By Minkowski's bound λ₁(L) ≤ √n · det(L)^{1/n}, an SVP_γ solution with γ ≥ 0 on a full-rank lattice in EuclideanSpace ℝ ι, n = |ι| ≥ 1, solves HSVP_{γ√n}.