mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 12:15:09 -05:00
feat: generate runtime context at Argument creation
This commit is contained in:
committed by
Quentin Bourgerie
parent
d1332dfd9a
commit
c6b1480cc6
@@ -6,6 +6,7 @@
|
||||
|
||||
extern "C" {
|
||||
#include "concrete-ffi.h"
|
||||
#include "zamalang/Runtime/context.h"
|
||||
}
|
||||
|
||||
#include "zamalang/Support/ClientParameters.h"
|
||||
@@ -40,6 +41,12 @@ public:
|
||||
CircuitGate inputGate(size_t pos) { return std::get<0>(inputs[pos]); }
|
||||
CircuitGate outputGate(size_t pos) { return std::get<0>(outputs[pos]); }
|
||||
|
||||
void generateRuntimeContext() {
|
||||
auto ksk = std::get<1>(this->keyswitchKeys["ksk_v0"]);
|
||||
auto bsk = std::get<1>(this->bootstrapKeys["bsk_v0"]);
|
||||
setGlobalRuntimeContext(createRuntimeContext(ksk, bsk));
|
||||
}
|
||||
|
||||
protected:
|
||||
llvm::Error generateSecretKey(LweSecretKeyID id, LweSecretKeyParam param,
|
||||
SecretRandomGenerator *generator);
|
||||
|
||||
@@ -234,6 +234,9 @@ JITLambda::Argument::Argument(KeySet &keySet) : keySet(keySet) {
|
||||
for (auto i = inputs.size(); i < rawArg.size(); i++) {
|
||||
rawArg[i] = &outputs[i - inputs.size()];
|
||||
}
|
||||
|
||||
// Setup runtime context with appropriate keys
|
||||
keySet.generateRuntimeContext();
|
||||
}
|
||||
|
||||
JITLambda::Argument::~Argument() {
|
||||
|
||||
Reference in New Issue
Block a user