Documentation Index
Fetch the complete documentation index at: https://docs.privora.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Complete reference of supported FHE operations.
Arithmetic Operations
| Operation | Method | Operator | Returns |
|---|
| Addition | a.add(&b)? | &a + &b | Encrypted<T> |
| Subtraction | a.sub(&b)? | &a - &b | Encrypted<T> |
| Multiplication | a.mul(&b)? | &a * &b | Encrypted<T> |
Comparison Operations
| Operation | Method | Returns |
|---|
| Greater or Equal | a.ge(&b)? | EncryptedBool |
| Greater Than | a.gt(&b)? | EncryptedBool |
| Less or Equal | a.le(&b)? | EncryptedBool |
| Less Than | a.lt(&b)? | EncryptedBool |
| Equal | a.eq_enc(&b)? | EncryptedBool |
Min/Max Operations
| Operation | Method | Returns |
|---|
| Minimum | a.min(&b)? | Encrypted<T> |
| Maximum | a.max(&b)? | Encrypted<T> |
Conditional Operations
| Operation | Method | Returns |
|---|
| Select | cond.select(&true_val, &false_val)? | Encrypted<T> |
Supported Types
| Type | Rust | Range |
|---|
| u8 | Encrypted<u8> | 0-255 |
| u32 | Encrypted<u32> | 0-4,294,967,295 |
| u64 | Encrypted<u64> | 0-18,446,744,073,709,551,615 |
Operation Costs
| Operation | Relative Cost |
|---|
| Addition | 1x |
| Subtraction | 1x |
| Multiplication | 2-3x |
| Comparison | 5-10x |
| Min/Max | 5-10x |
| Select | 5-10x |
Syscalls
Low-level syscall functions:
use privora_sdk_program::ops::syscalls::*;
fn fhe_add(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_sub(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_mul(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_ge(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_gt(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_le(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_lt(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_eq(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_min(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;
fn fhe_max(a: &[u8], b: &[u8]) -> Result<Vec<u8>, ProgramError>;