apotocki/mbedtls
Mbed TLS, a small, portable implementation of TLS, DTLS, X.509 and the PSA Cryptography API.
- Library
- mbedtls
- Newest
- 4.2.0 (r1, android)
- Targets
- android, apple, linux, windows
- License
- Apache-2.0 OR GPL-2.0-or-later
- Homepage
- https://www.trustedfirmware.org/projects/mbed-tls/
- Documentation
- https://mbed-tls.readthedocs.io
- Keywords
- tls, ssl, x509, crypto, cryptography, psa
Use it
In otok.toml:
[deps.mbedtls]
recipe = "apotocki/mbedtls"
version = "~> 4.2.0"
Versions
| Version | Target | Channel | Published | Status |
|---|---|---|---|---|
| 4.2.0 (r1, android) | android | stable | 2026-11-10 | |
| 4.2.0 (r1, apple) | apple | stable | 2026-11-10 | |
| 4.2.0 (r1, linux) | linux | stable | 2026-11-10 | |
| 4.2.0 (r1, windows) | windows | stable | 2026-11-10 |
4.2.0 (r1, android)
Platforms
android
Toolchains
cmake { default-recipe = "apotocki/cmake", version = ">= 3.20" }ninja { default-recipe = "apotocki/ninja", version = ">= 1.10" }
Recipe files
build.lua
-- Mbed TLS's CMake project, the libraries only, with the default configuration (include/mbedtls/mbedtls_config.h and
-- TF-PSA-Crypto's include/psa/crypto_config.h). Python, which the project looks for only to check the configuration,
-- is not looked for: nothing of the machine.
function build(slice, options, deps)
local static = slice.linkage == "static"
otok.cmake{ defines = {
ENABLE_PROGRAMS = false, ENABLE_TESTING = false, GEN_FILES = false,
MBEDTLS_FATAL_WARNINGS = false, TF_PSA_CRYPTO_FATAL_WARNINGS = false,
USE_STATIC_MBEDTLS_LIBRARY = static, USE_SHARED_MBEDTLS_LIBRARY = not static,
USE_STATIC_TF_PSA_CRYPTO_LIBRARY = static, USE_SHARED_TF_PSA_CRYPTO_LIBRARY = not static,
CMAKE_DISABLE_FIND_PACKAGE_Python3 = true,
} }
local p = slice.prefix
-- libtfpsacrypto.a or libtfpsacrypto.so (with its links on Linux), and so on
local lib = function(name) return p .. "/lib/lib" .. name .. (static and ".a" or ".so") end
return {
libraries = { mbedtls = lib("mbedtls"), mbedx509 = lib("mbedx509"), tfpsacrypto = lib("tfpsacrypto") },
headers = p .. "/include",
}
end
recipe.toml
# The otok recipe of Mbed TLS (https://github.com/apotocki/otok): libmbedtls, libmbedx509 and libtfpsacrypto (the
# PSA Cryptography API of TF-PSA-Crypto) for Android, from the release archive, with Mbed TLS's CMake and its default
# configuration; static or dynamic.
[recipe]
api = 1
library = "mbedtls"
name = "mbedtls"
version = "4.2.0"
revision = 1
license = "Apache-2.0 OR GPL-2.0-or-later"
license-files = ["LICENSE"]
homepage = "https://www.trustedfirmware.org/projects/mbed-tls/"
documentation = "https://mbed-tls.readthedocs.io"
description = "Mbed TLS, a small, portable implementation of TLS, DTLS, X.509 and the PSA Cryptography API."
keywords = ["tls", "ssl", "x509", "crypto", "cryptography", "psa"]
linkage = ["static", "dynamic"]
# The archive of the release, with TF-PSA-Crypto and the framework the git tag has as submodules, and the files its
# scripts generate; its SHA-256 is mbedtls-4.2.0-sha256sum.txt of the release.
[source]
url = "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-4.2.0/mbedtls-4.2.0.tar.bz2"
sha256 = "2bed9d713b4668f76553b097e72b8aa30bc8f112a940d7ae228d524bbde6ffea"
[platforms]
supported = ["android"]
build-on = ["*/ndk"]
[toolchains]
cmake = { version = ">= 3.20", default-recipe = "apotocki/cmake" }
ninja = { version = ">= 1.10", default-recipe = "apotocki/ninja" }
[[product]]
name = "MbedTLS"
libraries = ["mbedtls", "mbedx509", "tfpsacrypto"]