{
  "id": "2025/1322",
  "url": "https://opencryptology.org/2025/1322",
  "original_url": "https://eprint.iacr.org/2025/1322",
  "title": "Generation of Fast Finite Field Arithmetic for Cortex-M4 with ECDH and SQIsign Applications",
  "authors": [
    "Felix Carvalho Rodrigues",
    "Décio Gazzoni Filho",
    "Gora Adj",
    "Isaac A. Canales-Martínez",
    "Jorge Chávez-Saab",
    "Julio López",
    "Michael Scott",
    "Francisco Rodríguez-Henríquez"
  ],
  "affiliations": null,
  "abstract": "Finite field arithmetic is central to several cryptographic algorithms on embedded devices like the ARM Cortex-M4, particularly for elliptic curve and isogeny-based cryptography. However, rapid algorithm evolution, driven by initiatives such as NIST’s post-quantum standardization, might frequently render hand-optimized implementations obsolete.\nWe address this challenge with m4-modarith, a library generating C code with inline assembly for the Cortex-M4 that rivals custom-tuned assembly,\nenabling agile development in this ever-changing landscape.\nOur generated modular multiplications obtains fast performances, competitive with hand-optimized assembly implementations published in the literature, even outperforming some of them for Curve25519.\nTwo contributions are pivotal to this success.\nFirst, we introduce a novel multiplication strategy that matches the memory access complexity of the operand caching method while being applicable to a larger cache size for Cortex-M4 implementations. Second, we generalize an efficient pseudo-Mersenne reduction strategy, and formally prove its correctness and applicability for most primes of cryptographic interest.\nOur generator allowed agile optimization of SQIsign’s NIST PQC Round 2 submission, improving level 1 verification from 123 Mcycles to only 54 Mcycles, a $2.3\\times$ speedup.\nAs an additional case study, we use our generator to improve performance of portable implementations of RFC~7748 by up to $2.2\\times$.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Generation of Fast Finite Field Arithmetic for Cortex-M4 with ECDH and SQIsign Applications” by Felix Carvalho Rodrigues, Décio Gazzoni Filho, Gora Adj, Isaac A. Canales-Martínez, Jorge Chávez-Saab, Julio López, Michael Scott, Francisco Rodríguez-Henríquez, Cryptology ePrint Archive, Paper 2025/1322, https://eprint.iacr.org/2025/1322. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2025-07-18T20:45:40Z",
    "updated": "2025-07-18T20:45:40Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2025/1322.pdf",
    "sha256": "35e9c506bfeb5633fc74e30e1a4b146c9f9bd5fe2e94f4afdb24fa3faf2a356a",
    "size": 2190356,
    "source": "github-mirror",
    "source_date": "2026-04-28T17:20:00Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2025/1322/versions/20260428T172000Z.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "label": "copy captured 2026-04-28",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2025/1322.pdf",
      "size": 2190356,
      "sha256": "35e9c506bfeb5633fc74e30e1a4b146c9f9bd5fe2e94f4afdb24fa3faf2a356a",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2025/1322.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 2190356
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20251010101807id_/https://eprint.iacr.org/2025/1322.pdf",
      "captured_at": "2025-10-10T10:18:07Z",
      "size": 2086854
    }
  ],
  "bibtex": "@misc{cryptoeprint:2025/1322,\n      author = {Felix Carvalho Rodrigues and Décio Gazzoni Filho and Gora Adj and Isaac A. Canales-Martínez and Jorge Chávez-Saab and Julio López and Michael Scott and Francisco Rodríguez-Henríquez},\n      title = {Generation of Fast Finite Field Arithmetic for Cortex-M4 with ECDH and SQIsign Applications},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2025/1322},\n      year = {2025},\n      url = {https://eprint.iacr.org/2025/1322}\n}"
}
