Memory-Safe Production (Rust)
Rust
// Cargo.toml: vortex-pqc = "0.1.0"
use vortex_pqc::{Keypair, encapsulate, decapsulate};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut rng = rand::thread_rng();
let keypair = Keypair::generate(&mut rng);
let (ciphertext, shared_secret_bob) = encapsulate(&keypair.public, &mut rng);
let shared_secret_alice = decapsulate(&ciphertext, &keypair.secret)?;
assert_eq!(shared_secret_bob, shared_secret_alice);
Ok(())
}
Deterministic Systems (Native C)
C
// Optimized for kernel-level integrations and hardware-software co-design
#include "vortex_pqc.h"
uint8_t pk[VORTEX_PUBLIC_KEY_BYTES];
uint8_t sk[VORTEX_PRIVATE_KEY_BYTES];
uint8_t ct[VORTEX_CIPHERTEXT_BYTES];
uint8_t ss_alice[VORTEX_SHARED_SECRET_BYTES];
uint8_t ss_bob[VORTEX_SHARED_SECRET_BYTES];
// Zero-allocation, zero-copy execution pipeline
vortex_keypair(pk, sk);
vortex_encapsulate(ct, ss_bob, pk);
vortex_decapsulate(ss_alice, ct, sk);
High-Level Prototyping (Python)
Python
# pip install vortex-pqc
from vortex_pqc import generate_keypair, encapsulate, decapsulate
# Rapid integration testing for distributed agents
public_key, private_key = generate_keypair()
ciphertext, bob_secret = encapsulate(public_key)
alice_secret = decapsulate(ciphertext, private_key)