fix(runtime): enable concurrent key usage by cloning it on get operation.

This commit is contained in:
Antoniu Pop
2021-12-20 11:08:07 +00:00
committed by Antoniu Pop
parent e429180179
commit 2cba686c66

View File

@@ -1,3 +1,4 @@
#include "concrete-ffi.h"
#include "zamalang/Runtime/context.h"
#include <stdio.h>
@@ -6,5 +7,10 @@ LweKeyswitchKey_u64 *get_keyswitch_key(RuntimeContext *context) {
}
LweBootstrapKey_u64 *get_bootstrap_key(RuntimeContext *context) {
return context->bsk;
int err;
LweBootstrapKey_u64 *clone =
clone_lwe_bootstrap_key_u64(&err, context->bsk);
if (err != 0)
fprintf(stderr, "Runtime: cloning bootstrap key failed.\n");
return clone;
}