| Crates.io | apfsds-crypto |
| lib.rs | apfsds-crypto |
| version | 0.2.0 |
| created_at | 2026-01-17 15:47:53.20986+00 |
| updated_at | 2026-01-18 02:46:30.482316+00 |
| description | Cryptographic primitives for APFSDS (X25519, AES-GCM, Ed25519) |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2050691 |
| size | 40,032 |
Cryptographic primitives for APFSDS.
use apfsds_crypto::{AesGcmCipher, Ed25519Keypair, HmacAuth};
// AES-256-GCM encryption
let cipher = AesGcmCipher::new(&key);
let ciphertext = cipher.encrypt(plaintext)?;
let plaintext = cipher.decrypt(&ciphertext)?;
// Ed25519 signing
let keypair = Ed25519Keypair::generate();
let signature = keypair.sign(message);
assert!(keypair.verify(message, &signature));
// HMAC authentication
let auth = HmacAuth::new(&secret);
let token = auth.generate_token(user_id, expiry);
assert!(auth.verify_token(&token));
randMIT