No description
Find a file
faicel 53d5ad6a67
All checks were successful
Create prerelease tag on dev / tag_prerelease (push) Successful in 7s
Create Forgejo release on tag / release_on_tag (push) Successful in 1m4s
Merge pull request 'Fix ECDH' (#5) from fix_ecdh into dev
Reviewed-on: #5
2026-06-28 12:56:13 +00:00
.cargo Update atecc608x to version 0.2.0-rc.1 and enhance CI workflows. Bump version in Cargo.toml and Cargo.lock. Modify publish workflows to handle stable and prerelease tags, including linting and testing steps. 2026-03-18 22:44:56 +01:00
.claude Enhance ATECC608A driver with command delays and new sign functionality. Added specific delays for Sign and ECDH commands, updated nonce handling, and improved response parsing. Introduced tests for new sign methods and refined response packet handling. 2026-03-18 22:20:32 +01:00
.forgejo/workflows Update atecc608x to version 0.2.0-rc.3. Enhance Clippy linting by treating warnings as errors and mark unused KeyConfig mask constants to maintain clean builds. Update CHANGELOG.md with changes for this release. 2026-03-30 21:22:23 +02:00
scripts init 2026-03-07 15:50:07 +01:00
src Fix ECDH 2026-06-28 14:48:52 +02:00
.gitignore Update atecc608x to version 0.2.0-rc.2, add CHANGELOG.md, and refine driver code. Added WAKE_PULSE_ADDRESS constant for improved clarity in I2C communication, updated Cargo files, and enhanced README with changelog details. 2026-03-30 13:44:17 +02:00
Cargo.lock Fix ECDH 2026-06-28 14:48:52 +02:00
Cargo.toml Fix ECDH 2026-06-28 14:48:52 +02:00
CHANGELOG.md Fix ECDH 2026-06-28 14:48:52 +02:00
LICENSE init 2026-03-07 15:50:07 +01:00
README.md Update atecc608x to version 0.2.0-rc.2, add CHANGELOG.md, and refine driver code. Added WAKE_PULSE_ADDRESS constant for improved clarity in I2C communication, updated Cargo files, and enhanced README with changelog details. 2026-03-30 13:44:17 +02:00
TFLXTLS_datasheet.txt init 2026-03-07 15:50:07 +01:00

ATECC608A Driver

no_std driver for the Microchip ATECC608A Secure Element.

Description

This crate provides a Rust interface for the ATECC608A Secure Element, supporting:

  • P-256 ECDSA key pair generation
  • P-256 ECDSA digital signatures
  • P-256 ECDH key exchange
  • Secure key storage (private keys never exposed to the MCU)

Features

  • no_std compatible
  • Uses embedded-hal I2C traits
  • Hardware-accelerated cryptographic operations
  • Private keys never exposed to the MCU
  • Protection against physical attacks

Usage

Adding to your project

Add the dependency from the Forgejo registry:

[dependencies]
atecc608x = { version = "0.1.0", registry = "forgejo" }
embedded-hal = "1.0.0"

Configure the Forgejo registry in your project (e.g. in .cargo/config.toml or environment) so Cargo can resolve the forgejo registry index and authentication.

Basic example

use atecc608x::Atecc608x;
use embedded_hal::i2c::I2c;

// Initialize the driver (pass &mut i2c; you keep ownership of the bus)
let mut atecc = Atecc608x::new(&mut delay, &mut i2c, 0x60)?;

// Generate a P-256 key pair in slot 0
let public_key = atecc.generate_keypair(0)?;

// Sign a message hash
let message_hash = [0u8; 32]; // SHA-256 hash
let signature = atecc.sign(0, &message_hash)?;

// Perform ECDH key exchange
let peer_public_key = [0u8; 65]; // Peer public key
let shared_secret = atecc.ecdh(0, &peer_public_key)?;

Project structure

atecc608x/
├── src/
│   ├── lib.rs          # Entry point and re-exports
│   ├── driver/         # Main driver implementation
│   ├── error.rs        # Error types
│   ├── types.rs        # Types (KeySlot, P256PublicKey, P256Signature)
│   ├── status.rs       # Status handling
│   └── setup/          # Configuration profiles
├── scripts/
│   └── test.sh         # Run tests
├── Cargo.toml
└── README.md