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.
FHE encryption using the network public key.
use privora_sdk_client::prelude::*;
let encryptor = privora.encryptor();
let encrypted: ClientEncrypted<u8> = encryptor.encrypt(100u8)?;
Constructor
new
pub fn new(public_key: PublicKey) -> Self
Create from public key.
from_file
pub fn from_file(path: impl AsRef<Path>) -> Result<Self>
Load public key from file.
Methods
encrypt
pub fn encrypt<T: Encryptable>(&self, value: T) -> Result<ClientEncrypted<T>>
Encrypt a value.
encrypt_u8
pub fn encrypt_u8(&self, value: u8) -> Result<ClientEncrypted<u8>>
encrypt_u32
pub fn encrypt_u32(&self, value: u32) -> Result<ClientEncrypted<u32>>
encrypt_u64
pub fn encrypt_u64(&self, value: u64) -> Result<ClientEncrypted<u64>>
encrypt_batch
pub fn encrypt_batch<T: Encryptable + Clone>(
&self,
values: &[T]
) -> Result<Vec<ClientEncrypted<T>>>
public_key
pub fn public_key(&self) -> &PublicKey
ClientEncrypted<T>
Encrypted value ready for submission.
Methods
data
pub fn data(&self) -> &[u8]
user_recovery
pub fn user_recovery(&self) -> Option<&UserRecoveryData>
has_user_recovery
pub fn has_user_recovery(&self) -> bool
with_user_recovery
pub fn with_user_recovery(mut self, recovery: UserRecoveryData) -> Self