HEaaN
Crypto Lab's great homomorphic encryption library
CollectiveKeyGenerator.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/Context.hpp"
14 #include "HEaaN/HEaaNExport.hpp"
15 
18 
19 #include <memory>
20 
21 namespace HEaaN {
22 
23 class CollectiveKeyGeneratorImpl;
24 class SecretKey;
25 class KeyPack;
26 class EncryptionKey;
27 class EvaluationKey;
28 class SparseSecretEncapsulationKey;
29 
38 public:
40  explicit CollectiveKeyGenerator(const Context &context);
41 
48  explicit CollectiveKeyGenerator(const Context &context,
49  const Context &context_sparse);
50 
58  genCommonRandomData(const CollectiveKeyGenConfig &config) const;
59 
68  CollectiveKeyGenData genKeyShare(const SecretKey &sk,
69  const CollectiveKeyGenData &crd) const;
70 
84  CollectiveKeyGenData aggregateKeyShare(
85  const std::vector<const CollectiveKeyGenData *> &parts) const;
86 
97  genMultKeyShareRoundOne(const SecretKey &sk, const SecretKey &tmp_sk,
98  const CollectiveKeyGenData &crd) const;
99 
110  genMultKeyShareRoundTwo(const SecretKey &sk, const SecretKey &tmp_sk,
111  const CollectiveKeyGenData &data_round_one) const;
112 
119  std::shared_ptr<EncryptionKey>
120  genEncKey(const CollectiveKeyGenData &crd,
121  const CollectiveKeyGenData &agg) const;
122 
129  std::shared_ptr<EvaluationKey>
130  genConjKey(const CollectiveKeyGenData &crd,
131  const CollectiveKeyGenData &agg) const;
132 
139  std::shared_ptr<EvaluationKey>
140  genRotKey(const CollectiveKeyGenData &crd,
141  const CollectiveKeyGenData &agg) const;
142 
148  std::shared_ptr<EvaluationKey>
149  genMultKey(const CollectiveKeyGenData &data_round_one,
150  const CollectiveKeyGenData &data_round_two) const;
151 
158  std::shared_ptr<SparseSecretEncapsulationKey>
159  genSparseSecretEncapsulationKey(const CollectiveKeyGenData &crd,
160  const CollectiveKeyGenData &agg) const;
161 
162 private:
163  std::shared_ptr<CollectiveKeyGeneratorImpl> impl_;
164 };
165 } // namespace HEaaN
HEaaN::CollectiveKeyGenConfig
Configuration for collective key generation on which key to generate.
Definition: CollectiveKeyGenConfig.hpp:19
HEaaN::SecretKey
Secret key class.
Definition: SecretKey.hpp:26
CollectiveKeyGenData.hpp
HEaaN::CollectiveKeyGenerator
A class generating public keys from secret keys provided by multiple parties.
Definition: CollectiveKeyGenerator.hpp:37
CollectiveKeyGenConfig.hpp
HEaaN::CollectiveKeyGenData
A class to describe data being transfered between parties on the process of generating public keys fr...
Definition: CollectiveKeyGenData.hpp:27
HEaaN::CollectiveKeyGenerator::impl_
std::shared_ptr< CollectiveKeyGeneratorImpl > impl_
Definition: CollectiveKeyGenerator.hpp:163
HEaaN::Context
std::shared_ptr< ContextContent > Context
Definition: Context.hpp:27
Context.hpp
HEaaNExport.hpp
HEAAN_API
#define HEAAN_API
Definition: HEaaNExport.hpp:26
HEaaN
Definition: Bootstrapper.hpp:16