#ifndef ZAMALANG_SUPPORT_CLIENTPARAMETERS_H_ #define ZAMALANG_SUPPORT_CLIENTPARAMETERS_H_ #include #include #include #include #include #include "zamalang/Support/V0Parameters.h" namespace mlir { namespace zamalang { typedef size_t DecompositionLevelCount; typedef size_t DecompositionBaseLog; typedef size_t PolynomialSize; typedef size_t Precision; typedef double Variance; typedef uint64_t LweSize; typedef uint64_t GLWESize; typedef std::string LweSecretKeyID; struct LweSecretKeyParam { LweSize size; }; typedef std::string BootstrapKeyID; struct BootstrapKeyParam { LweSecretKeyID inputSecretKeyID; LweSecretKeyID outputSecretKeyID; DecompositionLevelCount level; DecompositionBaseLog baseLog; GLWESize k; Variance variance; }; typedef std::string KeyswitchKeyID; struct KeyswitchKeyParam { LweSecretKeyID inputSecretKeyID; LweSecretKeyID outputSecretKeyID; DecompositionLevelCount level; DecompositionBaseLog baseLog; Variance variance; }; struct Encoding { Precision precision; }; struct EncryptionGate { LweSecretKeyID secretKeyID; Variance variance; Encoding encoding; }; struct CircuitGateShape { // Width of the scalar value size_t width; // Size of the buffer size_t size; }; struct CircuitGate { llvm::Optional encryption; CircuitGateShape shape; }; struct ClientParameters { std::map secretKeys; std::map bootstrapKeys; std::map keyswitchKeys; std::vector inputs; std::vector outputs; }; llvm::Expected createClientParametersForV0(V0FHEContext context, llvm::StringRef name, mlir::ModuleOp module); } // namespace zamalang } // namespace mlir #endif