#pragma once namespace homcert::bfv { /* TODO Device handles pluggability of implementations (e.g. SEAL vs. GPU) Operations are queued on device so the device can parallelize ops */ /* No device class at all, just the context class which is handed to system as shared_ptr activate_context(std::shared_ptr ctx) -> thread local pointer is set Raw ciphertext and plaintext classes always have the full 8192 coefficients (defined in context as static constexpr) bfv::vector<...> -> can be plaintext or ciphertext -> can be base (owns plain-/ciphertext) or component (view to part of base) -> can be local or remote -> can be a single vector or multiple vectors/components (variadic) -> arithmetic with component masks it out -> arithmetic with base does operation on all components -> tracks multiplicative depth -> warning/error if multiplicative depth exceeds limit -> use bootstrap member function to handle the warnings/errors -> callbacks to reach peer in context -> bootstrap_client (unchecked, just raw bootstrap, checks happen at an upper layer using other callbacks) -> bootstrap_server_await (waits for client to make request) -> bootstrap_server_serve (called immediately after request received with value to be returned) -> automatically does secure reveal when cipher is transformed to plain -> queues operations until used (cast to plaintext, communication with peer) Programs are defined TWICE -> local stuff is executed -> remote stuff is hosted (e.g. bootstrapping server) -> defined once from each side (differ e.g. in the plaintext inputs etc.) */ }