mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 11:35:02 -05:00
For debugging purpose, add a cmake variable that allows to generate unsecure keycaches, that allows tracing ops to show the message in the ciphertext body.
34 lines
961 B
C++
34 lines
961 B
C++
#ifndef TEST_TOOLS_KEYSETCACHE_H
|
|
#define TEST_TOOLS_KEYSETCACHE_H
|
|
|
|
#include "concretelang/ClientLib/KeySetCache.h"
|
|
#include "llvm/Support/Path.h"
|
|
|
|
#ifdef CONCRETELANG_TEST_KEYCACHE_PATH
|
|
#define CACHE_PATH CONCRETELANG_TEST_KEYCACHE_PATH
|
|
#else
|
|
#define CACHE_PATH "KeySetCache"
|
|
#endif
|
|
|
|
static inline std::optional<concretelang::clientlib::KeySetCache>
|
|
getTestKeySetCache() {
|
|
|
|
llvm::SmallString<0> cachePath;
|
|
llvm::sys::path::system_temp_directory(true, cachePath);
|
|
llvm::sys::path::append(cachePath, CACHE_PATH);
|
|
|
|
auto cachePathStr = std::string(cachePath);
|
|
|
|
std::cout << "Using KeySetCache dir: " << cachePathStr << "\n";
|
|
|
|
return std::optional<concretelang::clientlib::KeySetCache>(
|
|
concretelang::clientlib::KeySetCache(cachePathStr));
|
|
}
|
|
|
|
static inline std::shared_ptr<concretelang::clientlib::KeySetCache>
|
|
getTestKeySetCachePtr() {
|
|
return std::make_shared<concretelang::clientlib::KeySetCache>(
|
|
getTestKeySetCache().value());
|
|
}
|
|
#endif
|