HEaaN
Crypto Lab's great homomorphic encryption library
CollectiveKeyGenConfig.hpp
Go to the documentation of this file.
1 // //
3 // Copyright (C) 2021-2023 Crypto Lab Inc. //
4 // //
5 // - This file is part of HEaaN homomorphic encryption library. //
6 // - HEaaN cannot be copied and/or distributed without the express permission //
7 // of Crypto Lab Inc. //
8 // //
10 
11 #pragma once
12 
13 #include "HEaaN/HEaaNExport.hpp"
14 #include "HEaaN/Integers.hpp"
15 
16 namespace HEaaN {
17 
20  enum Type : uint32_t { Enc, Mult, Rot, Conj, SparseSecretEncapsulation };
21 
23  i64 rot_idx = 0;
24 
26  i64 rot_idx_input = 0)
27  : type(type_input), rot_idx(rot_idx_input) {}
28 
29  bool operator==(const CollectiveKeyGenConfig &other) const {
30  if (type == Type::Rot)
31  return type == other.type && rot_idx == other.rot_idx;
32  return type == other.type;
33  }
34  bool operator!=(const CollectiveKeyGenConfig &other) const {
35  return !(*this == other);
36  }
37 
38  template <class Archive> void serialize(Archive &ar) { ar(type, rot_idx); }
39 };
40 
41 } // namespace HEaaN
HEaaN::CollectiveKeyGenConfig
Configuration for collective key generation on which key to generate.
Definition: CollectiveKeyGenConfig.hpp:19
HEaaN::CollectiveKeyGenConfig::operator==
bool operator==(const CollectiveKeyGenConfig &other) const
Definition: CollectiveKeyGenConfig.hpp:29
HEaaN::CollectiveKeyGenConfig::CollectiveKeyGenConfig
CollectiveKeyGenConfig(CollectiveKeyGenConfig::Type type_input, i64 rot_idx_input=0)
Definition: CollectiveKeyGenConfig.hpp:25
HEaaN::i64
std::int64_t i64
Definition: Integers.hpp:18
Integers.hpp
HEaaN::CollectiveKeyGenConfig::rot_idx
i64 rot_idx
Definition: CollectiveKeyGenConfig.hpp:23
HEaaN::CollectiveKeyGenConfig::type
Type type
Definition: CollectiveKeyGenConfig.hpp:22
HEaaN::CollectiveKeyGenConfig::Type
Type
Definition: CollectiveKeyGenConfig.hpp:20
HEaaN::CollectiveKeyGenConfig::serialize
void serialize(Archive &ar)
Definition: CollectiveKeyGenConfig.hpp:38
HEaaNExport.hpp
HEAAN_API
#define HEAAN_API
Definition: HEaaNExport.hpp:26
HEaaN::CollectiveKeyGenConfig::operator!=
bool operator!=(const CollectiveKeyGenConfig &other) const
Definition: CollectiveKeyGenConfig.hpp:34
HEaaN
Definition: Bootstrapper.hpp:16