Crypto API Reference
Complete reference for H33's cryptographic API suite. Post-quantum signatures (ML-DSA, ML-KEM, Falcon), fully homomorphic encryption (BFV, CKKS, TFHE), zero-knowledge proofs (Groth16, PLONK), and secure multi-party computation.
Dilithium (ML-DSA) NIST PQC
NIST FIPS 204 standardized post-quantum digital signatures. Lattice-based security resistant to quantum attacks. Three security levels: ML-DSA-44 (NIST Level 2), ML-DSA-65 (Level 3), ML-DSA-87 (Level 5).
Generate a new Dilithium keypair for post-quantum digital signatures.
Request
{
"security_level": "ML-DSA-65" // ML-DSA-44 | ML-DSA-65 | ML-DSA-87
}
Response
{
"public_key": "base64...",
"secret_key": "base64...",
"algorithm": "ML-DSA-65"
}
Sign a message using Dilithium secret key.
Request
{
"message": "base64_encoded_message",
"secret_key": "base64_encoded_secret_key"
}
Response
{
"signature": "base64..."
}
Verify a Dilithium signature against a message and public key.
Request
{
"message": "base64_encoded_message",
"signature": "base64_encoded_signature",
"public_key": "base64_encoded_public_key"
}
Response
{
"valid": true
}
Kyber (ML-KEM) NIST PQC
NIST FIPS 203 standardized post-quantum key encapsulation mechanism. Provides quantum-resistant key exchange. Three security levels: ML-KEM-512, ML-KEM-768, ML-KEM-1024.
Generate a new Kyber keypair for quantum-resistant key encapsulation.
Request
{
"security_level": "ML-KEM-768" // ML-KEM-512 | ML-KEM-768 | ML-KEM-1024
}
Response
{
"public_key": "base64...",
"secret_key": "base64...",
"algorithm": "ML-KEM-768"
}
Encapsulate a shared secret using the recipient's public key.
Request
{
"public_key": "base64_encoded_public_key"
}
Response
{
"ciphertext": "base64...",
"shared_secret": "base64..." // 32 bytes
}
Decapsulate the shared secret using your secret key.
Request
{
"ciphertext": "base64_encoded_ciphertext",
"secret_key": "base64_encoded_secret_key"
}
Response
{
"shared_secret": "base64..." // Same 32 bytes as sender
}
Falcon NIST PQC
NIST selected post-quantum signature scheme based on NTRU lattices. Compact signatures with fast verification. Two variants: Falcon-512 (NIST Level 1) and Falcon-1024 (NIST Level 5).
Generate a new Falcon keypair.
Request
{
"variant": "Falcon-512" // Falcon-512 | Falcon-1024
}
Sign a message with Falcon. Compact signatures ideal for bandwidth-constrained applications.
Verify a Falcon signature. Very fast verification.
FHE - BFV Scheme FHE
Brakerski/Fan-Vercauteren scheme for fully homomorphic encryption over integers. Ideal for exact integer arithmetic on encrypted data. Supports addition and multiplication.
Generate BFV encryption keys including public key, secret key, and relinearization key.
Request
{
"security_level": "128" // 128 | 192 | 256
}
Response
{
"public_key": "base64...",
"secret_key": "base64...",
"relin_key": "base64...",
"session_id": "uuid..."
}
Encrypt an integer vector. Supports batching for SIMD-style operations.
Request
{
"plaintext": [1, 2, 3, 4, 5], // i64 array
"public_key": "base64..."
}
Response
{
"ciphertext": "base64..."
}
Decrypt a BFV ciphertext back to plaintext integers.
Request
{
"ciphertext": "base64...",
"secret_key": "base64..."
}
Response
{
"plaintext": [1, 2, 3, 4, 5]
}
Homomorphically add two ciphertexts. Result decrypts to sum of plaintexts.
Request
{
"ciphertext_a": "base64...",
"ciphertext_b": "base64..."
}
Homomorphically multiply two ciphertexts. Requires relinearization key to maintain ciphertext size.
Request
{
"ciphertext_a": "base64...",
"ciphertext_b": "base64...",
"relin_key": "base64..."
}
FHE - CKKS Scheme FHE
Cheon-Kim-Kim-Song scheme for fully homomorphic encryption over approximate numbers. Ideal for machine learning and floating-point computations on encrypted data. Supports bootstrapping for unlimited computation depth.
Generate CKKS encryption keys with configurable precision and computation depth.
Request
{
"security_level": "128",
"scale_bits": 40 // Precision: 2^40
}
Encrypt real numbers (floats) into a CKKS ciphertext.
Request
{
"plaintext": [1.5, 2.7, 3.14159, -0.5], // f64 array
"public_key": "base64..."
}
Decrypt a CKKS ciphertext back to approximate real numbers.
Homomorphically add two CKKS ciphertexts.
Compute encrypted cosine similarity for ML matching. Perfect for biometric feature comparison without decryption.
Request
{
"encrypted_vector_a": "base64...",
"encrypted_vector_b": "base64...",
"relin_key": "base64..."
}
Response
{
"encrypted_similarity": "base64..." // Decrypt to get 0.0-1.0
}
FHE - TFHE Scheme FHE
Torus FHE for fast boolean operations and programmable bootstrapping. Ideal for encrypted comparisons and conditional logic without decryption.
Generate TFHE encryption keys with bootstrapping keys.
Encrypt boolean values for gate operations.
Request
{
"value": true,
"public_key": "base64..."
}
Homomorphically compare two encrypted values. Returns encrypted comparison result.
Request
{
"encrypted_a": "base64...",
"encrypted_b": "base64...",
"operation": "gt" // gt | lt | eq | gte | lte
}
Check if encrypted value exceeds a threshold. Perfect for encrypted access control.
Request
{
"encrypted_value": "base64...",
"threshold": 0.85 // Plaintext threshold
}
ZKP - Groth16 ZKP
Groth16 is the most efficient pairing-based zkSNARK. Constant-size proofs (192 bytes) with fast verification. Requires trusted setup per circuit.
Generate a zero-knowledge proof of identity without revealing the identity itself.
Request
{
"identity_secret": "base64...",
"salt": "base64..."
}
Response
{
"proof": "base64...",
"commitment": "base64..." // Public commitment to identity
}
Prove knowledge of a hash preimage without revealing it.
Request
{
"preimage": "base64..."
}
Response
{
"proof": "base64...",
"hash": "base64..." // Public hash output
}
Verify a Groth16 proof against public inputs.
Request
{
"proof": "base64...",
"circuit_type": "identity", // identity | hash-preimage
"public_inputs": {
"commitment": "base64..."
}
}
Response
{
"valid": true
}
Get the verifying key for a circuit. Use for client-side verification.
Response
{
"vk": "base64...",
"circuit_type": "identity"
}
ZKP - PLONK ZKP
PLONK is a universal zkSNARK with a single trusted setup for all circuits. Larger proofs than Groth16 but more flexible. Used for biometric matching proofs.
Generate a zero-knowledge proof that biometric features match a reference without revealing the features themselves. H33's patent-pending biometric ZKP.
Request
{
"biometric_features": [0.123, 0.456, ...], // 128 floats
"reference_features": [0.124, 0.455, ...], // 128 floats
"salt": "base64...",
"threshold": 0.85,
"identity_commitment": "base64...",
"ws_session_id": "optional_websocket_id"
}
Response
{
"job_id": "uuid...",
"ws_url": "wss://api.h33.ai/ws/crypto"
}
// Final result (via WebSocket or polling):
{
"proof": "base64...",
"public_inputs": {
"identity_commitment": "base64...",
"threshold": 0.85
},
"match_result": true // Whether match exceeds threshold
}
Verify a PLONK biometric proof.
Request
{
"proof": "base64...",
"public_inputs": {
"identity_commitment": "base64...",
"threshold": 0.85
}
}
Response
{
"valid": true
}
MPC - Secure Multi-Party Computation MPC
Secure multi-party computation allows multiple parties to jointly compute a function over their inputs while keeping those inputs private.
Initialize a new MPC session with specified participants and computation type.
Request
{
"participants": 3,
"threshold": 2, // t-of-n threshold
"computation": "sum" // sum | average | max | min | custom
}
Response
{
"session_id": "uuid...",
"participant_ids": ["p1", "p2", "p3"],
"public_params": "base64..."
}
Submit an encrypted share to the MPC session.
Request
{
"participant_id": "p1",
"encrypted_share": "base64..."
}
Trigger computation once threshold shares are collected. Returns result to all participants.
Response
{
"result": 42, // The computed result
"proof": "base64..." // Proof of correct computation
}