1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
pub mod core {
extern crate curve25519_dalek;
extern crate elgamal_ristretto;
use crate::errors::{QueryError, StorageError};
use curve25519_dalek::scalar::Scalar;
use elgamal_ristretto::ciphertext::Ciphertext;
pub trait Storage {
fn add(&self, content: Scalar, index: usize) -> Result<(), StorageError>;
fn retrieve(&self, query: Vec<Ciphertext>) -> Result<Ciphertext, StorageError>;
}
pub trait Query {
fn extract_result(&self, result: Ciphertext, k: u32) -> Result<Scalar, QueryError>;
}
}