Skip to main content

Crate astrid_crypto

Crate astrid_crypto 

Source
Expand description

Astrid Crypto - Cryptographic primitives for the secure agent runtime.

This crate provides:

  • Ed25519 key pairs with secure memory handling
  • Signatures for capability tokens and audit entries
  • BLAKE3 content hashing for audit chains and verification

§Security Philosophy

Cryptography over prompts. Authorization comes from ed25519 signatures and capability tokens, not from hoping the LLM follows instructions.

§Example

use astrid_crypto::{KeyPair, ContentHash};

// Generate a new key pair
let keypair = KeyPair::generate();

// Sign a message
let message = b"important data";
let signature = keypair.sign(message);

// Verify the signature
assert!(keypair.verify(message, &signature).is_ok());

// Hash content
let hash = ContentHash::hash(message);
println!("Hash: {}", hash.to_hex());

Modules§

prelude
Prelude module - commonly used types for convenient import.

Structs§

ContentHash
A BLAKE3 content hash (32 bytes).
KeyPair
An Ed25519 key pair with secure memory handling.
PublicKey
A public key (safe to share, serialize, etc.).
Signature
An Ed25519 signature (64 bytes).

Enums§

CryptoError
Errors that can occur during cryptographic operations.

Type Aliases§

CryptoResult
Result type for cryptographic operations.