HEaaN
Crypto Lab's great homomorphic encryption library
|
A class generating public keys from secret keys provided by multiple parties. More...
#include <CollectiveKeyGenerator.hpp>
Public Member Functions | |
CollectiveKeyGenerator (const Context &context) | |
Construct a CollectiveKeyGenerator object with a given context. More... | |
CollectiveKeyGenerator (const Context &context, const Context &context_sparse) | |
Construct a module for generating collective key including keys for sparse secret encapsulation for the given context. More... | |
CollectiveKeyGenData | genCommonRandomData (const CollectiveKeyGenConfig &config) const |
Generate a random data to be shared among parties for collective key generation. More... | |
CollectiveKeyGenData | genKeyShare (const SecretKey &sk, const CollectiveKeyGenData &crd) const |
Generate key share, the data which can be aggregated to generate collective key for encryption / conjugation / rotation / sparse secret encapsulation. More... | |
CollectiveKeyGenData | aggregateKeyShare (const std::vector< const CollectiveKeyGenData * > &parts) const |
Aggregate key share from each party. More... | |
CollectiveKeyGenData | genMultKeyShareRoundOne (const SecretKey &sk, const SecretKey &tmp_sk, const CollectiveKeyGenData &crd) const |
Perform round one for collective mult(relinearization) key generation. More... | |
CollectiveKeyGenData | genMultKeyShareRoundTwo (const SecretKey &sk, const SecretKey &tmp_sk, const CollectiveKeyGenData &data_round_one) const |
Perform round two for collective mult(relinearization) key generation. More... | |
std::shared_ptr< EncryptionKey > | genEncKey (const CollectiveKeyGenData &crd, const CollectiveKeyGenData &agg) const |
Collectively generate key for encryption. More... | |
std::shared_ptr< EvaluationKey > | genConjKey (const CollectiveKeyGenData &crd, const CollectiveKeyGenData &agg) const |
Collectively generate key for conjugation. More... | |
std::shared_ptr< EvaluationKey > | genRotKey (const CollectiveKeyGenData &crd, const CollectiveKeyGenData &agg) const |
Collectively generate key for rotation. More... | |
std::shared_ptr< EvaluationKey > | genMultKey (const CollectiveKeyGenData &data_round_one, const CollectiveKeyGenData &data_round_two) const |
Collectively generate key for multiplication. More... | |
std::shared_ptr< SparseSecretEncapsulationKey > | genSparseSecretEncapsulationKey (const CollectiveKeyGenData &crd, const CollectiveKeyGenData &agg) const |
Collectively generate key for sparse secret encapsulation. More... | |
Private Attributes | |
std::shared_ptr< CollectiveKeyGeneratorImpl > | impl_ |
A class generating public keys from secret keys provided by multiple parties.
Generate collectively known public key for encryption / multiplication / conjugation / rotation / sparse secret encapsulation. The class member functions should be performed in sequential order.
|
explicit |
Construct a CollectiveKeyGenerator
object with a given context.
|
explicit |
Construct a module for generating collective key including keys for sparse secret encapsulation for the given context.
RuntimeException | if context_sparse is not a context constructed with the corresponding sparse parameter of which constructed context. Please refer to getSparseParameterPresetFor() on ParameterPreset.hpp for the sparse parameters. |
CollectiveKeyGenData HEaaN::CollectiveKeyGenerator::aggregateKeyShare | ( | const std::vector< const CollectiveKeyGenData * > & | parts | ) | const |
Aggregate key share from each party.
[in] | parts | a vector of key shares obtained from genKeyShare(). |
RuntimeException | if all the parts is not created to generate the same key. |
parts
were generated. aggregated key share is used to generate collective key in genAndSaveCollectiveKey().As computation which is performed on this function is addition, user may eagerly evaluate aggregation when only a subset of required CollectiveKeyGenData are prepared, as below : auto aggregated_part_AB = aggregateKeyShare({&part_A, &part_B}); auto aggregated_part_ABC = aggregateKeyShare({&aggregated_part_AB, &part_C});
CollectiveKeyGenData HEaaN::CollectiveKeyGenerator::genCommonRandomData | ( | const CollectiveKeyGenConfig & | config | ) | const |
Generate a random data to be shared among parties for collective key generation.
[in] | config | Configuration representing the key type for which collective key generated. |
std::shared_ptr<EvaluationKey> HEaaN::CollectiveKeyGenerator::genConjKey | ( | const CollectiveKeyGenData & | crd, |
const CollectiveKeyGenData & | agg | ||
) | const |
Collectively generate key for conjugation.
[in] | crd | Common random data obtained from genCommonRandomData(). |
[in] | agg | aggregated key share obtained from aggregateKeyShare(). |
RuntimeException | if crd or agg are not created to generate conjugation key |
std::shared_ptr<EncryptionKey> HEaaN::CollectiveKeyGenerator::genEncKey | ( | const CollectiveKeyGenData & | crd, |
const CollectiveKeyGenData & | agg | ||
) | const |
Collectively generate key for encryption.
[in] | crd | Common random data obtained from genCommonRandomData(). |
[in] | agg | aggregated key share obtained from aggregateKeyShare(). |
RuntimeException | if crd or agg are not created to generate encryption key |
CollectiveKeyGenData HEaaN::CollectiveKeyGenerator::genKeyShare | ( | const SecretKey & | sk, |
const CollectiveKeyGenData & | crd | ||
) | const |
Generate key share, the data which can be aggregated to generate collective key for encryption / conjugation / rotation / sparse secret encapsulation.
[in] | sk | Secret key |
[in] | crd | Common random data obtained from genCommonRandomData(). |
crd
was generated. key shares are aggregated by aggregateKeyShare(). std::shared_ptr<EvaluationKey> HEaaN::CollectiveKeyGenerator::genMultKey | ( | const CollectiveKeyGenData & | data_round_one, |
const CollectiveKeyGenData & | data_round_two | ||
) | const |
Collectively generate key for multiplication.
[in] | data_round_one | Returned data from genMultKeyShareRoundOne(). |
[in] | data_round_two | Returned data from genMultKeyShareRoundTwo(). |
RuntimeException | if data_round_one or data_round_two are not created to generate multiplication key |
CollectiveKeyGenData HEaaN::CollectiveKeyGenerator::genMultKeyShareRoundOne | ( | const SecretKey & | sk, |
const SecretKey & | tmp_sk, | ||
const CollectiveKeyGenData & | crd | ||
) | const |
Perform round one for collective mult(relinearization) key generation.
[in] | sk | Secret key |
[in] | tmp_sk | |
[in] | crd | Common random data obtained from genCommonRandomData(). |
RuntimeException | if crd is not generated for multiplication key |
CollectiveKeyGenData HEaaN::CollectiveKeyGenerator::genMultKeyShareRoundTwo | ( | const SecretKey & | sk, |
const SecretKey & | tmp_sk, | ||
const CollectiveKeyGenData & | data_round_one | ||
) | const |
Perform round two for collective mult(relinearization) key generation.
[in] | sk | Secret key |
[in] | tmp_sk | |
[in] | data_round_one | Returned data from genMultKeyShareRoundOne(). |
RuntimeException | if data_round_one is not generated for multiplication key |
std::shared_ptr<EvaluationKey> HEaaN::CollectiveKeyGenerator::genRotKey | ( | const CollectiveKeyGenData & | crd, |
const CollectiveKeyGenData & | agg | ||
) | const |
Collectively generate key for rotation.
[in] | crd | Common random data obtained from genCommonRandomData(). |
[in] | agg | aggregated key share obtained from aggregateKeyShare(). |
RuntimeException | if crd or agg are not created to generate rotation key |
std::shared_ptr<SparseSecretEncapsulationKey> HEaaN::CollectiveKeyGenerator::genSparseSecretEncapsulationKey | ( | const CollectiveKeyGenData & | crd, |
const CollectiveKeyGenData & | agg | ||
) | const |
Collectively generate key for sparse secret encapsulation.
[in] | crd | Common random data obtained from genCommonRandomData(). |
[in] | agg | aggregated key share obtained from aggregateKeyShare(). |
RuntimeException | if crd or agg are not created to generate sparse secret encapsulation key |
|
private |