Choosing the right FHE scheme is crucial for your application's success. BFV and CKKS are the two most widely used schemes, each with distinct strengths. This guide helps you make the right choice.
Understanding the Fundamental Difference
The core distinction lies in how they handle data:
- BFV (Brakerski/Fan-Vercauteren): Exact integer arithmetic—perfect for comparisons, counting, and precise calculations
- CKKS (Cheon-Kim-Kim-Song): Approximate arithmetic on real/complex numbers—ideal for machine learning and statistical analysis
Quick Decision Guide
Use BFV when: You need exact results (biometric matching, database queries, voting)
Use CKKS when: Approximate results are acceptable (ML inference, statistical analysis)
BFV Deep Dive
BFV operates on integers modulo a plaintext modulus. Key characteristics:
- Exact computation with no precision loss
- Efficient for operations that map well to integer arithmetic
- Supports batching (SIMD operations on multiple values)
- Noise grows with multiplication depth
H33 uses BFV for biometric template matching because we need exact distance calculations to determine match/no-match decisions accurately.
CKKS Deep Dive
CKKS encodes real numbers with controlled precision loss:
- Native support for floating-point-like operations
- Rescaling operation manages noise after multiplications
- Excellent for polynomial approximations of functions
- Well-suited for neural network inference
Performance Comparison
Performance varies by operation type:
- Addition: Similar performance, both very fast (~microseconds)
- Multiplication: CKKS slightly faster due to rescaling efficiency
- Comparison: BFV more natural; CKKS requires polynomial approximation
- Division: Neither supports directly; requires approximation
Use Case Examples
BFV Applications:
- Biometric matching (exact distance computation)
- Private database queries (exact equality/range checks)
- Electronic voting (counting must be exact)
- Financial calculations requiring precision
CKKS Applications:
- Machine learning inference
- Medical data analysis
- Signal processing
- Statistical computations
Implementation Considerations
When implementing either scheme:
- Parameter selection: Both require careful tuning for security and performance
- Noise budget: Plan your computation depth in advance
- Encoding: Understand how your data maps to the scheme's native format
- Bootstrapping: Consider if you need unlimited computation depth
The choice between BFV and CKKS depends entirely on your application's requirements. For most identity and authentication use cases, BFV's exact arithmetic makes it the better choice.
Ready to Go Quantum-Secure?
Start protecting your users with post-quantum authentication today. 1,000 free auths, no credit card required.
Get Free API Key →