Documentation

Complexity.Crypto.Computational.Homomorphic.GSW.Serialized

Executable serialized GSW keys and ciphertexts #

Residues are written with exactly w bits, least significant first, and matrices are row major. The dimensions are explicit inputs to the algorithms. Missing list entries and bits are zero; excess data is ignored. Integer errors are reduced by Euclidean remainder, so negative errors wrap correctly. These conventions specify total behavior on malformed inputs.

The programs below compute the public matrix and ciphertext of Gentry, Sahai and Waters, Section 3.1. The computational certificates are separate from the exact algebraic bridges. No security or bootstrappability is asserted.

Main definitions #

Main results #

Exact deterministic and distributional bridges are in GSW.Serialized.Correctness; native certificates for the complete programs are in GSW.Serialized.PolyTime.

References #

Canonical public matrices use the generic fixed-width row-major representation.

Instances For
    def Cslib.Crypto.Homomorphic.GSW.serializeSecret {n w : ℕ} (secret : Fin n → ZMod (2 ^ w)) :

    Canonical secret residues are consecutive low-order-first words.

    Instances For
      def Cslib.Crypto.Homomorphic.GSW.decodeSecret (n w : ℕ) (word : List Bool) :
      Fin n → ZMod (2 ^ w)

      Total secret decoding reads the declared number of residue words, padding with zero bits.

      Instances For
        @[simp]
        theorem Cslib.Crypto.Homomorphic.GSW.decode_serializeSecret {n w : ℕ} (secret : Fin n → ZMod (2 ^ w)) :
        decodeSecret n w (serializeSecret secret) = secret

        Canonical secret words retain every residue.

        @[simp]
        @[simp]
        theorem Cslib.Crypto.Homomorphic.GSW.length_serializeSecret {n w : ℕ} (secret : Fin n → ZMod (2 ^ w)) :
        (serializeSecret secret).length = n * w

        Ciphertext coordinates (i, k) are ordered by i * w + k, in rows and columns.

        Instances For

          Total ciphertext decoding uses the declared dimensions and pads absent bits with false.

          Instances For
            @[simp]

            Canonical ciphertext words retain every bit.

            @[simp]

            The complete ciphertext has the expected square number of bits.

            Compute the leading entry B * secret + error of a public row in binary arithmetic.

            Instances For

              Compute the public word from arbitrary serialized sampled inputs.

              Instances For

                Normalize and serialize an arbitrary secret list to the declared dimensions.

                Instances For
                  def Cslib.Crypto.Homomorphic.GSW.encryptEntry (n m w : ℕ) (publicWord : List Bool) (message : Bool) (coins : SerializedCoins) (i k j : ℕ) :

                  One entry of message * G + R * A, before its bit decomposition.

                  Instances For

                    Compute all ciphertext bits from the actual public word, message and Boolean coins.

                    Instances For

                      Sample the existing random inputs and run the actual public-key computation.

                      Instances For
                        noncomputable def Cslib.Crypto.Homomorphic.GSW.encryptSerialized (n m w : ℕ) (publicWord : List Bool) (message : Bool) :

                        Sample the existing Boolean coins and run the actual ciphertext computation.

                        Instances For