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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#![deny(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(missing_docs)]
#[cfg(not(target_arch = "wasm32"))]
extern crate link_cplusplus;
#[allow(dead_code)]
#[allow(non_camel_case_types)]
mod bindgen {
use std::os::raw::c_long;
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
pub const E_OK: c_long = 0x0;
pub const E_POINTER: c_long = 0x80004003u32 as c_long;
pub const E_INVALIDARG: c_long = 0x80070057u32 as c_long;
pub const E_OUTOFMEMORY: c_long = 0x8007000Eu32 as c_long;
pub const E_UNEXPECTED: c_long = 0x8000FFFFu32 as c_long;
pub const COR_E_IO: c_long = 0x80131620u32 as c_long;
pub const COR_E_INVALIDOPERATION: c_long = 0x80131509u32 as c_long;
}
mod serialization {
#[repr(u8)]
pub enum CompressionType {
ZStd = 2,
}
}
mod bfv_evaluator;
mod context;
mod encoder;
mod encryption_parameters;
mod encryptor_decryptor;
mod error;
mod evaluator;
mod evaluator_base;
mod key_generator;
mod modulus;
mod plaintext_ciphertext;
pub use bfv_evaluator::BFVEvaluator;
pub use context::Context;
pub use encoder::{BFVEncoder, BFVScalarEncoder};
pub use encryption_parameters::*;
pub use encryptor_decryptor::{Decryptor, Encryptor};
pub use error::{Error, Result};
pub use evaluator::Evaluator;
pub use key_generator::{GaloisKeys, KeyGenerator, PublicKey, RelinearizationKeys, SecretKey};
pub use modulus::{CoefficientModulus, Modulus, PlainModulus, SecurityLevel};
pub use plaintext_ciphertext::{Ciphertext, Plaintext};
pub trait ToBytes {
fn as_bytes(&self) -> Result<Vec<u8>>;
}
pub trait FromBytes {
fn from_bytes(context: &Context, bytes: &[u8]) -> Result<Self>
where
Self: Sized;
}