MCPcopy Index your code
hub / github.com/apache/teaclave-trustzone-sdk

github.com/apache/teaclave-trustzone-sdk @v0.9.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.9.0 ↗ · + Follow
1,056 symbols 2,118 edges 216 files 232 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Apache Teaclave™ TrustZone SDK

License Release Homepage

Apache Teaclave™ 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 the capability to write TrustZone applications with Rust's standard library (std) and many third-party libraries (i.e., crates).

Apache Teaclave™ TrustZone SDK provides two development modes for Rust TAs: no-std and std. We recommend using no-std by default. For a detailed comparison, please refer to Comparison.

UPDATES: We have developed a new build environment on the main branch, which will now be the only branch for development and maintenance and includes breaking changes to the legacy master branch. If you're using the master branch and wish to migrate to the new development branch (main), please refer to the migration guide.

🚀 Quick & Easy Start: Hello World TA in Emulator

Developing Trusted Applications (TAs) often requires specific hardware, which can be a barrier for many developers. To address this, we provide a prebuilt Docker environment that allows you to experience TAs without the need for physical hardware.

The Docker image automates the entire setup process for TrustZone emulation in QEMU, enabling you to focus on writing and testing your applications efficiently, without the hassle of manual configuration.

UPDATES: We have introduced a more convenient build tool, cargo-optee, which provides better abstraction and a more ergonomic developer experience. In the long term, we plan to gradually move away from the Makefile + Cargo workflow and adopt a more idiomatic Rust-based development approach. To ensure a smooth transition, the existing Makefile-based build components are still retained and supported.

Choose your development mode in Emulator: - 🚀 Quick Emulation And Development in Docker - 🚀 Developing TAs with Rust Standard Library

Advanced Setup: Customize Your Build Environment

In addition to developing and testing Trusted Applications (TAs) in the QEMU emulator, setting up build configurations for specific hardware targets are also necessary. For detailed instructions on customizing your build environment, please refer to the Advanced Setup Documentation.

For other tips regarding the support Rust Examples, TA debugging, expanding secure memory, please refer to the docs/ directory.

Publication

More details about the design and implementation can be found in our paper published in ACSAC 2020: RusTEE: Developing Memory-Safe ARM TrustZone Applications. Here is the BiBTeX record for your reference.

@inproceedings{wan20rustee,
    author    = "Shengye Wan and Mingshen Sun and Kun Sun and Ning Zhang and Xu
He",
    title     = "{RusTEE: Developing Memory-Safe ARM TrustZone Applications}",
    booktitle = "Proceedings of the 36th Annual Computer Security Applications
Conference",
    series    = "ACSAC '20",
    year      = "2020",
    month     = "12",
}

Contributing

Apache Teaclave™ is open source in The Apache Way, we aim to create a project that is maintained and owned by the community. All kinds of contributions are welcome. Thanks to our contributors.

Apache Teaclave™ follows the Apache Software Foundation (ASF) model, which does not require Signed-off-by or other commit trailers. While such tags (e.g., DCO-style trailers like Signed-off-by, Reviewed-by) are welcome, they are optional and not enforced. Pull requests with or without them are equally welcome.

However, DCO-style tags cannot substitute for the Contributor License Agreement (CLA). Major contributions and all committers must have a signed CLA on file, as required by the ASF.

Community

Extension points exported contracts — how you extend this code

PropertyValue (Interface)
Represents a TEE property value. The property value can be of different types, such as string, bool, u32, TEE_UUID, TEE_ [7 …
crates/optee-utee/src/property.rs
Param (Interface)
(no doc) [3 implementers]
crates/optee-teec/src/parameter.rs
Storable (Interface)
(no doc) [2 implementers]
crates/secure_db/src/storable.rs
OpHandle (Interface)
A trait for a crypto operation to return its handle. [6 implementers]
crates/optee-utee/src/crypto_op.rs
GenericObject (Interface)
A generic trait for an object (transient or persistent). [3 implementers]
crates/optee-utee/src/object/generic_object.rs
SocketAdapter (Interface)
A trait designed to accommodate various implementations of GP TEE Sockets API. An implementation of this trait is respo [2 …
crates/optee-utee/src/net/socket.rs
StdCompatConnect (Interface)
A trait used for convenience; import it so that the code remains consistent with the std version (with the only differen [1 …
crates/optee-utee/src/net/optee_no_std.rs

Core symbols most depended-on inside this repo

into
called by 124
crates/optee-utee/src/net/optee_std.rs
buffer
called by 75
crates/optee-utee/src/parameter.rs
as_memref
called by 61
crates/optee-utee/src/parameter.rs
invoke_command
called by 57
examples/client_pool-rs/host/src/pool/connection.rs
clone
called by 53
crates/optee-teec/src/uuid.rs
data_ptr
called by 47
crates/optee-utee/src/arithmetical.rs
build
called by 28
crates/optee-utee-build/src/lib.rs
handle
called by 27
crates/optee-utee/src/crypto_op.rs

Shape

Function 422
Method 386
Class 160
Enum 78
Interface 10

Languages

Rust100%

Modules by API surface

crates/optee-utee/src/crypto_op.rs46 symbols
crates/optee-utee/src/arithmetical.rs33 symbols
crates/optee-utee/src/tee_parameter.rs30 symbols
crates/optee-utee-sys/src/tee_api_types.rs25 symbols
crates/optee-utee/src/extension.rs20 symbols
crates/optee-utee/src/parameter.rs19 symbols
crates/optee-utee-build/src/code_generator.rs19 symbols
crates/optee-teec/src/parameter.rs17 symbols
tools/cargo-optee/src/common.rs15 symbols
crates/optee-utee/src/object/persistent_object.rs15 symbols
tools/cargo-optee/src/config.rs14 symbols
examples/aes-rs/ta/src/main.rs14 symbols

For agents

$ claude mcp add teaclave-trustzone-sdk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page