# OPHE Test Implementation ## Requirements Rust 1.59.0+ stable ### Notes - Relies on the (security of) bls12_381 crate (This crate has been forked to include a few serialization methods: https://github.com/Kradxn/bls12_381) - Every cryptographic operation should run in constant time - Every major(time consuming) math operation is parallalized using rusts par_iter and should leverage all available cores - Modules: - Core: Core cryptographic primtives - Proofs: Same DLog NiZK - Shamir: Shamir Secret sharing implemented for Scalar and Gt Elements - Utils: Common util code e.g. generation a random element, building the message space and encoding a message - Serializers: Code for Automatic serialization of Scalars and Gt Elements - Cryptoservice: Code for the rudimentary cryptoservice implementation - Ophe: Code for the rudimentary webclient implementation # Running the cryptoservice ```ROCKET_PORT=9999 cargo run --release --bin cryptoservice``` # Running the webclient A rudimentary webclient is available. Currently providing a custom message(for now 32 bytes of value 0 are encrypted) for encryption is not possbile. ```cargo run --release --bin ophe``` Go to http://localhost:8000/rapidoc to checkout the documentation. # Benchmarking Benchmark can be run by ```cargo test --release -- --nocapture``` Of course it should be done using --release otherwise performance optimization do not run Every performance test can be edited to specify the number of threads used by changing 1 in ``` rayon::ThreadPoolBuilder::new().num_threads(1).build_global().unwrap(); ``` to the number of threads you want to use (Meaning the mulitple cpu cores can be used) Tested with Rust 1.59.0 stable ## Todo - Split core functionality from the webclient code into 2 seperate crates