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§
- Content
Hash - A BLAKE3 content hash (32 bytes).
- KeyPair
- An Ed25519 key pair with secure memory handling.
- Public
Key - A public key (safe to share, serialize, etc.).
- Signature
- An Ed25519 signature (64 bytes).
Enums§
- Crypto
Error - Errors that can occur during cryptographic operations.
Type Aliases§
- Crypto
Result - Result type for cryptographic operations.