Skip to content
Rust OP-TEE TrustZone SDK: Enabling Safe, Functional, and Ergonomic Development of Trustlets
Branch: master
Clone or download

Rust OP-TEE TrustZone SDK

Rust OP-TEE TrustZone SDK provides abilities to build safe TrustZone applications in Rust. The SDK is based on the OP-TEE project which follows GlobalPlatform TEE specifications and provides ergonomic APIs. In addition, it enables capability to write TrustZone applications with Rust's standard library and many third-party libraries (i.e., crates).

Rust OP-TEE TrustZone SDK is under the MesaTEE project.

Getting started

To get started, you need to clone the project, initialize related submodules, and install building dependencies. Alternatively, you can use a docker container built with our Dockerfile.

# clone the project and initialize related submodules
$ git clone
$ cd rust-optee-trustzone-sdk
$ git submodule update --init
$ (cd rust/compiler-builtins && git submodule update --init libm compiler-rt)
$ (cd rust/rust && git submodule update --init src/stdsimd)

# install dependencies
$ sudo apt-get install curl make gcc python python-crypto xz-utils

# install Rust and select a proper version
$ curl -sSf | sh -s -- -y --default-toolchain nightly-2019-02-27
$ source $HOME/.cargo/env
$ rustup component add rust-src && rustup target install aarch64-unknown-linux-gnu

# install patched Xargo
$ cargo install --git --branch mssun/relative-patch-path --force

Then, download ARM toolchains and build OP-TEE libraries. Note that the OP-TEE target is QEMUv8, and you can modify the Makefile to other targets accordingly.

$ make optee

Before building examples, the environment should be properly setup.

$ source environment

At last, you can get started with our examples.

$ make examples

Please read detailed instructions to run these examples on OP-TEE for QEMU. For other supported devices, please find more documents here.


The project is maintained by Mingshen Sun (@mssun) and Shengye Wan (@SimonWan), under the supervision of steering committee (Tao Wei and Yulong Zhang). Contributions are very welcome, please submit issues or send pull requests


Rust OP-TEE TrustZone SDK is distributed under the Apache License (Version 2.0). See LICENSE for details.

You can’t perform that action at this time.