apache/teaclave-sgx-sdk

Apache Teaclave™ SGX SDK helps developers to write Intel SGX applications in the Rust programming language, and also known as Rust SGX SDK.

Rust

1,232

652 commits

updated Jun 10, 2026

See the code

README

Apache Teaclave™ SGX SDK

License Homepage

Apache Teaclave™ SGX SDK is a Rust SDK for developing Intel SGX applications. It enables developers to write secure, privacy-preserving applications using Intel Software Guard Extensions (SGX) technology with the safety and performance benefits of the Rust programming language.

Overview

Apache Teaclave™ SGX SDK provides a comprehensive development environment for building Intel SGX enclaves in Rust. The current version (v2.0) offers significant improvements over the legacy v1.1 , including:

  • Modern Build System: Supports cargo build with no_std, xargo build, and cargo-std-aware modes
  • Rich Ecosystem: Direct support for Tokio and Tonic in enclave programming without modifications
  • Lightweight Architecture: Refactored Intel's SGX SDK using Rust, requiring only a minimal portion of Intel's original SDK
  • Robust Testing: Comprehensive testing framework with well-tested sgx_tstd standard library
  • Simplified Dependencies: Eliminates the need to maintain 100+ third-party dependencies; most Rust crates work without modifications

Build System

The SDK supports multiple build modes to accommodate different development preferences:

  • BUILD_STD=cargo (default): Uses the new std-aware cargo build system
  • BUILD_STD=no: Traditional no_std cargo build for minimal footprint
  • BUILD_STD=xargo: Uses xargo build with customized sysroot

Sample Applications

The following sample applications demonstrate various SGX SDK capabilities:

  • backtrace: Stack trace functionality in SGX enclaves
  • cov: Code coverage analysis tools
  • crypto: Cryptographic operations within enclaves
  • helloworld: Basic SGX enclave example
  • httpreq: HTTP client functionality
  • hyper-rustls-https-server: HTTPS server using Hyper and Rustls
  • logger: Logging capabilities for SGX applications
  • regex: Regular expression processing
  • rpc: Remote procedure calls using Tonic and Tokio
  • seal: Data sealing and unsealing operations
  • switchless: Switchless call optimization
  • zlib-lazy-static-sample: Compression with lazy static initialization

Note: Migration of additional v1.1 samples to v2.0 is ongoing.

Getting Started

For detailed installation instructions, development guides, and API documentation, please visit:

Contributing

Apache Teaclave™ is developed in the open following The Apache Way. We strive to maintain a project that is community-driven and inclusive.

We welcome all forms of contributions. Please refer to our Contributing Guide for more information. A big thank-you to all our contributors!

Community

confidential-computing
rust
sgx
tee
trusted-execution-environment
universal-secure-computing

apache/teaclave-sgx-sdk

Apache Teaclave™ SGX SDK helps developers to write Intel SGX applications in the Rust programming language, and also known as Rust SGX SDK.

Rust

1,232

652 commits

updated Jun 10, 2026

See the code

README

Apache Teaclave™ SGX SDK

License Homepage

Apache Teaclave™ SGX SDK is a Rust SDK for developing Intel SGX applications. It enables developers to write secure, privacy-preserving applications using Intel Software Guard Extensions (SGX) technology with the safety and performance benefits of the Rust programming language.

Overview

Apache Teaclave™ SGX SDK provides a comprehensive development environment for building Intel SGX enclaves in Rust. The current version (v2.0) offers significant improvements over the legacy v1.1 , including:

  • Modern Build System: Supports cargo build with no_std, xargo build, and cargo-std-aware modes
  • Rich Ecosystem: Direct support for Tokio and Tonic in enclave programming without modifications
  • Lightweight Architecture: Refactored Intel's SGX SDK using Rust, requiring only a minimal portion of Intel's original SDK
  • Robust Testing: Comprehensive testing framework with well-tested sgx_tstd standard library
  • Simplified Dependencies: Eliminates the need to maintain 100+ third-party dependencies; most Rust crates work without modifications

Build System

The SDK supports multiple build modes to accommodate different development preferences:

  • BUILD_STD=cargo (default): Uses the new std-aware cargo build system
  • BUILD_STD=no: Traditional no_std cargo build for minimal footprint
  • BUILD_STD=xargo: Uses xargo build with customized sysroot

Sample Applications

The following sample applications demonstrate various SGX SDK capabilities:

  • backtrace: Stack trace functionality in SGX enclaves
  • cov: Code coverage analysis tools
  • crypto: Cryptographic operations within enclaves
  • helloworld: Basic SGX enclave example
  • httpreq: HTTP client functionality
  • hyper-rustls-https-server: HTTPS server using Hyper and Rustls
  • logger: Logging capabilities for SGX applications
  • regex: Regular expression processing
  • rpc: Remote procedure calls using Tonic and Tokio
  • seal: Data sealing and unsealing operations
  • switchless: Switchless call optimization
  • zlib-lazy-static-sample: Compression with lazy static initialization

Note: Migration of additional v1.1 samples to v2.0 is ongoing.

Getting Started

For detailed installation instructions, development guides, and API documentation, please visit:

Contributing

Apache Teaclave™ is developed in the open following The Apache Way. We strive to maintain a project that is community-driven and inclusive.

We welcome all forms of contributions. Please refer to our Contributing Guide for more information. A big thank-you to all our contributors!

Community

confidential-computing
rust
sgx
tee
trusted-execution-environment
universal-secure-computing

Project health

Overall

3.8/10

Maintained

0/10

Code review

3/10
OpenSSF Scorecard

Significant stargazers

(top 24 of 32)

Corey Farwell

590 followers · starred Oct 2017

Brian Anderson

2,521 followers · starred Aug 2018

Tony Arcieri

2,013 followers · starred Jul 2017

Jake Bailey

1,255 followers · starred Oct 2017