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.
Low-level functions for accessing the content-addressable store.
fetch_data
pub fn fetch_data(hash: &[u8; 32]) -> Result<Vec<u8>, ProgramError>
Fetch data from the content-addressable store by hash.
Parameters:
hash - 32-byte SHA256 hash of the data
Returns:
Ok(Vec<u8>) - The ciphertext data
Err(ProgramError) - If data not found or fetch failed
Example:
use privora_sdk_program::ops::syscalls::fetch_data;
let hash: [u8; 32] = account.price_ref.hash();
let ciphertext = fetch_data(&hash)?;
submit_data
pub fn submit_data(data: &[u8]) -> Result<[u8; 32], ProgramError>
Submit data to the content-addressable store.
Parameters:
data - The ciphertext bytes to store
Returns:
Ok([u8; 32]) - SHA256 hash of the stored data
Err(ProgramError) - If submission failed
Example:
use privora_sdk_program::ops::syscalls::submit_data;
let ciphertext: Vec<u8> = compute_result();
let hash = submit_data(&ciphertext)?;
Constants
/// Maximum fetch size (100KB)
pub const MAX_FETCH_SIZE: usize = 100 * 1024;
/// Hash size (32 bytes)
pub const HASH_SIZE: usize = 32;
High-Level Methods
Prefer using methods on encrypted types:
// Loading
let value: Encrypted<u8> = encrypted_ref.load()?;
// Storing
let ref: EncryptedRef<u8> = value.store()?;