style(test): Formatting

This commit is contained in:
Quentin Bourgerie
2022-02-11 14:43:35 +01:00
committed by Quentin Bourgerie
parent de66044374
commit 0439ef47da
3 changed files with 67 additions and 75 deletions

View File

@@ -8,57 +8,52 @@ namespace CL = mlir::concretelang;
TEST(Support, client_parameters_json_serde) {
mlir::concretelang::ClientParameters params0;
params0.secretKeys = {
{mlir::concretelang::SMALL_KEY, {/*.size = */ 12}},
{mlir::concretelang::BIG_KEY, {/*.size = */ 14}},
{mlir::concretelang::SMALL_KEY, {/*.size = */ 12}},
{mlir::concretelang::BIG_KEY, {/*.size = */ 14}},
};
params0.bootstrapKeys = {
{
"bsk_v0", {
/*.inputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
{"bsk_v0",
{/*.inputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
/*.outputSecretKeyID = */ mlir::concretelang::BIG_KEY,
/*.level = */ 1,
/*.baseLog = */ 2,
/*.k = */ 3,
/*.variance = */ 0.001
}
},{
"wtf_bsk_v0", {
/*.inputSecretKeyID = */ mlir::concretelang::BIG_KEY,
/*.outputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
/*.level = */ 3,
/*.baseLog = */ 2,
/*.k = */ 1,
/*.variance = */ 0.0001,
}
},
/*.glweDimension = */ 3,
/*.variance = */ 0.001}},
{"wtf_bsk_v0",
{
/*.inputSecretKeyID = */ mlir::concretelang::BIG_KEY,
/*.outputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
/*.level = */ 3,
/*.baseLog = */ 2,
/*.glweDimension = */ 1,
/*.variance = */ 0.0001,
}},
};
params0.keyswitchKeys = {
{
"ksk_v0", {
/*.inputSecretKeyID = */ mlir::concretelang::BIG_KEY,
/*.outputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
/*.level = */ 1,
/*.baseLog = */ 2,
/*.variance = */ 3,
}
}
};
{"ksk_v0",
{
/*.inputSecretKeyID = */ mlir::concretelang::BIG_KEY,
/*.outputSecretKeyID = */ mlir::concretelang::SMALL_KEY,
/*.level = */ 1,
/*.baseLog = */ 2,
/*.variance = */ 3,
}}};
params0.inputs = {
{
/*.encryption = */ {{CL::SMALL_KEY, 0.01, {4}}},
/*.shape = */ {32, {1, 2, 3, 4}, 1 * 2 * 3 * 4},
},
{
/*.encryption = */ {{CL::SMALL_KEY, 0.03, {5}}},
/*.shape = */ {8, {4, 4, 4, 4}, 4 * 4 * 4 * 4},
},
{
/*.encryption = */ {{CL::SMALL_KEY, 0.01, {4}}},
/*.shape = */ {32, {1, 2, 3, 4}, 1 * 2 * 3 * 4},
},
{
/*.encryption = */ {{CL::SMALL_KEY, 0.03, {5}}},
/*.shape = */ {8, {4, 4, 4, 4}, 4 * 4 * 4 * 4},
},
};
params0.outputs = {
{
/*.encryption = */ {{CL::SMALL_KEY, 0.03, {5}}},
/*.shape = */ {8, {4, 4, 4, 4}, 4 * 4 * 4 * 4},
},
};
{
/*.encryption = */ {{CL::SMALL_KEY, 0.03, {5}}},
/*.shape = */ {8, {4, 4, 4, 4}, 4 * 4 * 4 * 4},
},
};
auto json = mlir::concretelang::toJSON(params0);
std::string jsonStr;
llvm::raw_string_ostream os(jsonStr);