{
  "id": "2022/1303",
  "url": "https://opencryptology.org/2022/1303",
  "original_url": "https://eprint.iacr.org/2022/1303",
  "title": "Fast and Clean: Auditable high-performance assembly via constraint solving",
  "authors": [
    "Amin Abdulrahman",
    "Hanno Becker",
    "Matthias J. Kannwischer",
    "Fabien Klein"
  ],
  "affiliations": null,
  "abstract": "Handwritten assembly is a widely used tool in the development of high-performance cryptography: By providing full control over instruction selection, instruction scheduling, and register allocation, highest performance can be unlocked. On the flip side, developing handwritten assembly is not only time-consuming, but the artifacts produced also tend to be difficult to review and maintain – threatening their suitability for use in practice.\nIn this work, we present SLOTHY (Super (Lazy) Optimization of Tricky Handwritten assemblY), a framework for the automated superoptimization of assembly with respect to instruction scheduling, register allocation, and loop optimization (software pipelining): With SLOTHY, the developer controls and focuses on algorithm and instruction selection, providing a readable “base” implementation in assembly, while SLOTHY automatically finds optimal and traceable instruction scheduling and register allocation strategies with respect to a model of the target (micro)architecture.\nWe demonstrate the flexibility of SLOTHY by instantiating it with models of the Cortex-M55, Cortex-M85, Cortex-A55 and Cortex-A72 microarchitectures, implementing the Armv8.1-M+Helium and AArch64+Neon architectures. We use the resulting tools to optimize three workloads: First, for Cortex-M55 and Cortex-M85, a radix-4 complex Fast Fourier Transform (FFT) in fixed-point and floating-point arithmetic, fundamental in Digital Signal Processing. Second, on Cortex-M55, Cortex-M85, Cortex-A55 and Cortex-A72, the instances of the Number Theoretic Transform (NTT) underlying CRYSTALS-Kyber and CRYSTALS-Dilithium, two recently announced winners of the NIST Post-Quantum Cryptography standardization project. Third, for Cortex-A55, the scalar multiplication for the elliptic curve key exchange X25519. The SLOTHY-optimized code matches or beats the performance of prior art in all cases, while maintaining compactness and readability.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Fast and Clean: Auditable high-performance assembly via constraint solving” by Amin Abdulrahman, Hanno Becker, Matthias J. Kannwischer, Fabien Klein, Cryptology ePrint Archive, Paper 2022/1303, https://eprint.iacr.org/2022/1303. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2022-09-30T16:31:59Z",
    "updated": "2023-10-06T13:48:28Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2022/1303.pdf",
    "sha256": "b1ac842754200593bbe27bc7b606e1b3b64c9d784f7c6dd2222a0625c7531e96",
    "size": 1237864,
    "source": "github-mirror",
    "source_date": "2024-01-14T06:13:34Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2022/1303/versions/20240114T061334Z.pdf",
      "captured_at": "2024-01-14T06:13:34Z",
      "label": "copy captured 2024-01-14",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2022/1303.pdf",
      "size": 1237864,
      "sha256": "b1ac842754200593bbe27bc7b606e1b3b64c9d784f7c6dd2222a0625c7531e96",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2022/1303/versions/20230331T060235Z.pdf",
      "captured_at": "2023-03-31T06:02:35Z",
      "label": "copy captured 2023-03-31",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20230331060235id_/https://eprint.iacr.org/2022/1303.pdf",
      "size": 1213107,
      "sha256": "721b7a162459a151939845cd6e2f718f86089ddd7f3f2d2508a51e63add51dad",
      "is_default_pdf": false
    },
    {
      "url": "https://opencryptology.org/2022/1303/versions/20221019T070040Z.pdf",
      "captured_at": "2022-10-19T07:00:40Z",
      "label": "copy captured 2022-10-19",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20221019070040id_/https://eprint.iacr.org/2022/1303.pdf",
      "size": 890045,
      "sha256": "9a3d8fe00a31b8b062f35b7dde96be323c1adf15e08f8f6c4af7762e2d61198f",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260523194353id_/https://eprint.iacr.org/2022/1303.pdf",
      "captured_at": "2026-05-23T19:43:53Z",
      "size": 1172590
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2022/1303.pdf",
      "captured_at": "2024-01-14T06:13:34Z",
      "size": 1237864
    }
  ],
  "bibtex": "@misc{cryptoeprint:2022/1303,\n      author = {Amin Abdulrahman and Hanno Becker and Matthias J. Kannwischer and Fabien Klein},\n      title = {Fast and Clean: Auditable high-performance assembly via constraint solving},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2022/1303},\n      year = {2022},\n      url = {https://eprint.iacr.org/2022/1303}\n}"
}
