AdaCore: Build Software that Matters
I Stock 2198938705 1
Dec 03, 2026

wolfSSL's Ada wrapper available in Alire

TLS 1.3 in an Ada project is now a one-line dependency. wolfSSL's Ada/SPARK binding for wolfSSL 5.8.0 is in the Alire index: alr with wolfssl pulls the C library, its Ada binding and the build glue into your project.

wolfSSL announced it in December 2025. The binding itself has lived in the wolfSSL tree for a while; what changed is that you no longer have to clone the repository and wire it up by hand. That matters more than it sounds, because crypto is the one component nobody should write themselves, and the barrier to using a good one just dropped.

What is actually in the crate

The crate is a thin binding, not a rewrite. The Ada API lives in wolfssl.ads/wolfssl.adb and calls into the C library through a small shim, ada_binding.c. The C sources ship with it.

The design choices are the interesting part. The binding was written for the runtimes embedded and certified teams actually use:

  • No controlled types, no Ada.Finalization. Light runtimes often carry No_Finalization; the binding builds under it.
  • No secondary stack in the binding. restricted.adc applies No_Secondary_Stack, so GNAT's stack scrubbing can zero every frame the binding touches. The examples do use the secondary stack, and the Alire crate leaves the restriction to you.
  • SPARK-compatible. The repository ships (D)TLS 1.3 client and server examples in SPARK. The README's gnatprove --level=4 run reports 172 checks, all discharged: 58 run-time checks, 91 functional contracts, 6 assertions, 17 flow checks.

The Alire packaging was community work: PR #8606 by mgrojo in March 2025 cleaned up the Alire project and fixed some GNATprove findings in earlier contributions.

Try it in five minutes

alr init --bin tls_demo
cd tls_demo
alr with wolfssl
alr build

Alire will use a GNAT already on your PATH, or install one with alr toolchain --select. To prove your own code against the binding:

alr with gnatprove
alr gnatprove --level=4

The fastest way to see a working TLS 1.3 round trip is the examples in the wolfSSL tree, under wrapper/Ada/examples: alr run tls_server_main in one terminal, alr run tls_client_main --args=127.0.0.1 in another.

Why this matters for high-integrity teams

"Rewrite it in Ada" was never the right answer for cryptography. Proven, audited C libraries win on review history, interop testing, and certification evidence. The right pattern is a proven C core behind a SPARK boundary, and that is what this crate gives you: your protocol logic in SPARK, with absence of run-time errors proven, calling a library that has been through FIPS and DO-178 processes elsewhere.
For an architect, this also settles a recurring argument. "We need TLS, so this module has to be C" no longer holds. The TLS module can be Ada; only the crypto primitives stay C, and the boundary is a single binding you can read in an afternoon.

Three things to be clear-eyed about:

  • Memory safety stops at the boundary. The binding is thin. SPARK proves your side; the C library is still C, with all the usual COTS handling that implies.
  • alr with wolfssl is not a FIPS module. wolfSSL's FIPS 140-3 validation applies to the wolfCrypt FIPS module, licensed separately from wolfSSL. Confirm the exact configuration with wolfSSL before claiming it.
  • Alire crates are not qualified artefacts. For a certified build, treat the crate as a convenient way to obtain source; the evidence trail for the C library and your build still comes from wolfSSL and your own process.

What we would like to see next

wolfSSL asked in its post whether readers want post-quantum algorithms exposed in Ada. We do: ML-KEM and ML-DSA are already in wolfSSL's C API, and a SPARK-facing binding would let teams prove the handshake logic around them. If that is on your roadmap too, tell wolfSSL, and tell us.
Try the crate, test it, and file what you find against the wolfSSL repository. That is how it got into Alire in the first place.


Sources

FAQs

wolfSSL is a widely used C library for TLS, the protocol that secures data sent between systems. The Ada wrapper lets software written in Ada or SPARK use that library directly. Teams building high-integrity systems can now add proven encryption to their Ada code without writing their own cryptography, which experts generally advise against.

Alire is the package manager for Ada, similar to the tools other languages use to add ready-made libraries to a project. Before, developers had to download the wolfSSL source and set it up by hand. Now a single command adds the library, its Ada binding, and the build setup to a project, so getting started takes minutes instead of hours.

Not on its own. SPARK can prove properties of the Ada code you write around the library, such as the absence of certain runtime errors, but the underlying wolfSSL library is still C and still needs the usual checks that apply to third-party code.

Author

Mark Hermeling

Headshot
Head of Technical Marketing, AdaCore

Mark has over 25 years’ experience in software development tools for high-integrity, secure, embedded and real-time systems across automotive, aerospace, defence and industrial domains. As Head of Technical Marketing at AdaCore, he links technical capabilities to business value and is a regular author and speaker on on topics ranging from the software development lifecycle, DevSecOps to formal methods and software verification.

Blog_

Latest Blog Posts