/ascon-linear-layer

Quantum/Classical implementation of the linear diffusion layer of the ASCON encryption scheme.

Primary LanguagePython

ascon-linear-layer

This repository contains the results/codes on the paper, Quantum Implementation of ASCON Linear Layer [eprint and NIST LWC Workshop 2023].

Files

Matrix

  • Ascon.py contains the specification of the linear layer (which is a 320 × 320 binary matrix) as tuple of tuples data structure.
  • Ascon.sobj is the matrix stored in Sage's internal format for efficiency (it can be loaded as: M = load("Ascon.sobj")).

Implementations

  • Naïve

    • naive.txt contains the naïve quantum implementation (that uses 320 ancilla qubits).
  • In-place

    • gj.txt contains the implementation from the Gauss-Jordan elimination.
    • plu.txt contains the implementation from the PLU factorization.
    • xzlbz.txt contains the implementation from the modified XZLBZ code.

Note

  1. In all the implementations, the dummy variable x is used with its index starting at 0. The qubits are denoted as x[0], x[1] and so on.
  2. The first line for the in-place implementations indicates the relabel of qubits. It can be realized through a series of SWAP gates.
  3. In the naïve quantum implementation, the 320 ancilla qubits are denoted as x[320], ..., x[639].