DecryptionTable

Trait DecryptionTable 

Source
pub trait DecryptionTable: Send + Sync {
    // Required methods
    fn lookup(
        &self,
        key: [u8; 32],
    ) -> Pin<Box<dyn Future<Output = Result<Option<u32>>> + Send + 'static>>;
    fn store(
        &self,
        key: [u8; 32],
        value: u32,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>;

    // Provided method
    fn initialize(
        &self,
        k: usize,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>> { ... }
}
Expand description

A (possibly asynchronous) access to a discrete-log lookup table.

The keys of the table are 32-byte encodings of group elements, and the values are 32-bit integer discrete logarithms.

Before use, the decryption table should have been initialized with all discrete logarithms up to the maximum possible bitsize that can occur in decryption: 2^{16 + lg(N)}, where N is the number of ciphertexts to aggregate (e.g., aggregating up to 64 ciphertexts requires a table of size 2^{16 + 6} = 2^22). The provided initialize method will generate the necessary calls to store to initialize the table.

Required Methods§

Source

fn lookup( &self, key: [u8; 32], ) -> Pin<Box<dyn Future<Output = Result<Option<u32>>> + Send + 'static>>

Look up a 32-bit discrete logarithm by the byte-encoded group element.

Implementors should return Ok(None) on missing keys, and reserve Err(e) for underlying I/O errors.

Source

fn store( &self, key: [u8; 32], value: u32, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'static>>

Store a 32-bit discrete logarithm, indexed by the byte-encoded group element.

Provided Methods§

Source

fn initialize( &self, k: usize, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>

Initialize an empty table.

This will generate calls to store that record all discrete logarithms up to 2^k.

Implementors§