h33-client
Official Rust client for the H33 post-quantum cryptographic API.
One crate. Full access to FHE encryption, Dilithium signatures, Kyber key exchange, and biometric authentication — all post-quantum secure.
Install
[]
= "0.1"
Quick Start
use H33Client;
async
Environment Variables
| Variable | Default | Description |
|---|---|---|
H33_API_URL |
http://localhost:8080 |
API endpoint |
H33_API_KEY |
(required) | Your API key from h33.ai/pricing |
// Auto-configure from environment
let client = from_env?;
API Coverage
| Method | Endpoint | Description |
|---|---|---|
health() |
GET /health |
Service health check |
connect() |
POST /api/v1/auth/token |
Get JWT (optional, API key works) |
fhe_init(scheme) |
POST /api/v1/fhe/init |
Start FHE session (bfv/ckks) |
fhe_encrypt(session, plaintext) |
POST /api/v1/fhe/encrypt |
Encrypt plaintext |
fhe_decrypt(session, ciphertext) |
POST /api/v1/fhe/decrypt |
Decrypt ciphertext |
fhe_compute(session, op, operands) |
POST /api/v1/fhe/compute |
Homomorphic computation |
pq_encrypt(plaintext) |
POST /api/v1/encrypt |
Kyber + AES-256-GCM encrypt |
pq_decrypt(ciphertext) |
POST /api/v1/decrypt |
Hybrid decrypt |
sign(data) |
POST /api/v1/sign |
Dilithium signature |
verify(data, signature) |
POST /api/v1/verify |
Verify signature |
biometric_enroll(user, template) |
POST /api/v2/biometric/enroll |
Enroll FHE-encrypted template |
biometric_verify(user, template) |
POST /api/v2/biometric/verify |
Verify against enrolled template |
usage() |
GET /api/v1/usage |
Usage statistics |
Error Handling
All methods return h33_client::Result<T>. Errors include HTTP status, error code, message, and optional hint:
match client.fhe_encrypt.await
Performance
For latency-critical applications (biometric auth), use h33-fhe-client to move BFV encryption client-side, eliminating ~419us from the server pipeline.
License
MIT