HEaaN
Crypto Lab's great homomorphic encryption library
SecretKey.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 #include "HEaaN/Pointer.hpp"
16 #include "HEaaN/device/Device.hpp"
17 
18 namespace HEaaN {
19 class SecretKeyImpl;
20 class Polynomial;
21 
25 
27 public:
28  using Coefficients = int *;
30  explicit SecretKey(const Context &context);
34  explicit SecretKey(const Context &context, std::istream &stream);
38  explicit SecretKey(const Context &context, const std::string &key_dir_path);
39 
46  explicit SecretKey(const Context &context,
47  const Coefficients &coefficients);
48 
50  void save(const std::string &path) const;
52  void save(std::ostream &stream) const;
53 
57  void saveSeedOnly(const std::string &path) const;
61  void saveSeedOnly(std::ostream &stream) const;
62 
64  const Context &getContext() const;
65 
67  Polynomial &getSx();
69  const Polynomial &getSx() const;
70 
72  Coefficients getCoefficients() const;
73 
76  const Device &getDevice() const;
77 
80  void to(const Device &device);
81 
82 private:
84 };
85 
86 } // namespace HEaaN
HEaaN::SecretKey::Coefficients
int * Coefficients
Definition: SecretKey.hpp:28
HEaaN::SecretKey
Secret key class.
Definition: SecretKey.hpp:26
HEaaN::Pointer< SecretKeyImpl >
Device.hpp
HEaaN::SecretKey::impl_
Pointer< SecretKeyImpl > impl_
Definition: SecretKey.hpp:83
Pointer.hpp
HEaaN::Device
Definition: Device.hpp:33
HEaaN::Context
std::shared_ptr< ContextContent > Context
Definition: Context.hpp:27
HEaaN::save
HEAAN_API void save(const EvaluationKey &key, std::ostream &stream)
Save key to a given stream.
Context.hpp
HEaaNExport.hpp
HEAAN_API
#define HEAAN_API
Definition: HEaaNExport.hpp:26
HEaaN
Definition: Bootstrapper.hpp:16