Skip to main content

TEE attestation library for AMD SEV-SNP and Intel TDX platforms

Project description

FHEnom TEE Attestation Library

A Python library for generating and verifying TEE (Trusted Execution Environment) attestation reports across different hardware platforms.

Features

  • Multi-Platform Support: AMD SEV-SNP and Intel TDX
  • Unified API: Single interface for all TEE platforms
  • Cryptographic Verification: Full certificate chain validation
  • Production Ready: Used in FHEnom AI confidential computing platform

Supported Platforms

  • AMD SEV-SNP (Secure Encrypted Virtualization - Secure Nested Paging)
  • 🚧 Intel TDX (Trust Domain Extensions) - Coming soon

Basic Installation (Python API only)

pip install dk-tee-attestation

Quick Start

Generate an Attestation Report (Inside TEE)

from dk_tee_attestation import AttestationEngineFactory, AttestationEngineType

# Create AMD SEV-SNP engine
engine = AttestationEngineFactory.get(AttestationEngineType.AMD_SEV_SNP)

# Generate report with nonce (must be 64 bytes)
nonce = b"your_nonce_here" + b"\x00" * (64 - len(b"your_nonce_here"))
report_bytes = engine.get_report(nonce)

# Save for verification
with open("attestation_report.bin", "wb") as f:
    f.write(report_bytes)

Verify an Attestation Report (Verifier Side)

from dk_tee_attestation import AttestationEngineFactory, AttestationEngineType

# Create engine
engine = AttestationEngineFactory.get(AttestationEngineType.AMD_SEV_SNP)

# Load report
with open("attestation_report.bin", "rb") as f:
    report_bytes = f.read()

# Verify (raises exception on failure)
nonce = b"your_nonce_here" + b"\x00" * (64 - len(b"your_nonce_here"))
try:
    engine.verify_report(report_bytes, nonce)
    print("✓ Attestation verified successfully!")
except Exception as e:
    print(f"✗ Verification failed: {e}")

API Reference

AttestationEngine

Base interface for TEE attestation engines.


get_report(report_data: bytes) -> bytes

Generate a TEE attestation report.

Parameters

  • report_data (bytes): Nonce / challenge. Must be exactly 64 bytes.

Returns

  • bytes: Raw attestation report.

Raises

  • AttestationError: If report generation fails.

verify_report(report_bytes: bytes, expected_report_data: bytes) -> None

Verify a TEE attestation report.

Parameters

  • report_bytes (bytes): Raw attestation report to verify.
  • expected_report_data (bytes): Expected nonce. Must be exactly 64 bytes.

Returns

  • None: Verification succeeded.

Raises

  • AttestationError: If verification fails.

Verification Process

AMD SEV-SNP Verification Steps

  1. Parse Report: Extract structured data from raw bytes
  2. Validate Nonce: Ensure nonce matches expected value
  3. Fetch Certificates: Retrieve ARK, ASK, and VCEK from AMD KDS
  4. Verify Chain: Validate certificate chain signatures
  5. Check Metadata: Ensure TCB and hardware ID match
  6. Verify Signature: Validate report signature with VCEK

INTEL-TDX Verification Steps

🚧 - Coming soon

Platform-Specific Notes

AMD SEV-SNP

  • Requires access to /dev/sev-guest device for report generation
  • Fetches certificates from AMD Key Distribution Service (KDS)
  • Supports Milan, Genoa, and Turin processor families

Intel TDX

  • 🚧 Coming soon

Integration with FHEnom AI

This library is integrated into the FHEnom AI SDK:

# Install FHEnom AI with attestation support
pip install fhenomai

# Use via FHEnom AI client
from fhenomai import FHEnomClient

client = FHEnomClient.from_config()
result = client.admin.verify_attestation(report_bytes, nonce_hex)

Requirements

  • Python >= 3.8
  • cryptography >= 46.0.0
  • requests >= 2.32.0

Use Cases

  • Remote Attestation: Prove code runs in genuine TEE
  • Zero-Trust Security: Establish trust before sensitive operations
  • Compliance: Demonstrate hardware-backed security
  • Confidential Computing: Verify encrypted model execution

License

TBD

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dk_tee_attestation-0.4.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dk_tee_attestation-0.4.0-cp312-cp312-win_amd64.whl (124.7 kB view details)

Uploaded CPython 3.12Windows x86-64

dk_tee_attestation-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl (272.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file dk_tee_attestation-0.4.0.tar.gz.

File metadata

  • Download URL: dk_tee_attestation-0.4.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dk_tee_attestation-0.4.0.tar.gz
Algorithm Hash digest
SHA256 561faefbcc57adc6db2a04133c4a6bcd0fe4b6e5b1e3cbd87c34ea7f95770b13
MD5 05eeb76cfb8c9868b7ca6cf3997c6f5a
BLAKE2b-256 ca6feadea822a577ea16b0b2d8dd1fe82dd1e1bc37e7930256bb6282d68eff63

See more details on using hashes here.

File details

Details for the file dk_tee_attestation-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dk_tee_attestation-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 96ea6d1dee4ca7af80f8600f6850d27a33f413bd1b78c67909bd78f3a7765ee4
MD5 6f5c8c8eda16c3c9bfcb6a24b0ad01ee
BLAKE2b-256 07c0d0e3e5acafad830c1d6ae38c532993723358dc475b2280269a04277dcc08

See more details on using hashes here.

File details

Details for the file dk_tee_attestation-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for dk_tee_attestation-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5c8b7d5f0248acbda85cdab4c96972b3e56e8e1cb9693f27ad03e1995443c33f
MD5 7a7930e41e6045ed3d31ec4c38305d9e
BLAKE2b-256 ea2928e633bc4dfa1a6a04ca4371797b3859e1516b36d0076bb4464874252b1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page