Secret key class.
More...
#include <SecretKey.hpp>
◆ Coefficients
◆ SecretKey() [1/4]
HEaaN::SecretKey::SecretKey |
( |
const Context & |
context | ) |
|
|
explicit |
Generate random secret key.
◆ SecretKey() [2/4]
HEaaN::SecretKey::SecretKey |
( |
const Context & |
context, |
|
|
std::istream & |
stream |
|
) |
| |
|
explicit |
Load secret key from stream.
The key can be loaded regardless of whether the stream is saving the full key or its seed only.
◆ SecretKey() [3/4]
HEaaN::SecretKey::SecretKey |
( |
const Context & |
context, |
|
|
const std::string & |
key_dir_path |
|
) |
| |
|
explicit |
Load secret key from file.
The key can be loaded regardless of whether the stream is saving the full key or its seed only.
◆ SecretKey() [4/4]
Generate a secret key whose coefficients are copied from coefficients
and fits context
.
The key cannot be save or loaded by its seed. Instead of using a uniform random bit generator, it fills the secret key's coefficients with integers from coefficients[0] to coefficients[context->getDimension() - 1].
◆ getCoefficients()
Get integer representation of coefficients.
◆ getContext()
const Context& HEaaN::SecretKey::getContext |
( |
| ) |
const |
◆ getDevice()
const Device& HEaaN::SecretKey::getDevice |
( |
| ) |
const |
Get device a secret key reside in.
- Returns
- The device in which the secret key resides
◆ getSx() [1/2]
Polynomial& HEaaN::SecretKey::getSx |
( |
| ) |
|
Get sx part of secret key.
◆ getSx() [2/2]
const Polynomial& HEaaN::SecretKey::getSx |
( |
| ) |
const |
Get const sx part of secret key.
◆ save() [1/2]
void HEaaN::SecretKey::save |
( |
const std::string & |
path | ) |
const |
Save a secret key to file.
◆ save() [2/2]
void HEaaN::SecretKey::save |
( |
std::ostream & |
stream | ) |
const |
Save a secret key to stream.
◆ saveSeedOnly() [1/2]
void HEaaN::SecretKey::saveSeedOnly |
( |
const std::string & |
path | ) |
const |
Save the seed of a secret key to file.
The seed can reproduce the key under different parameter (Context) too.
◆ saveSeedOnly() [2/2]
void HEaaN::SecretKey::saveSeedOnly |
( |
std::ostream & |
stream | ) |
const |
Save the seed of a secret key to stream.
The seed can reproduce the key under different parameter (Context) too.
◆ to()
void HEaaN::SecretKey::to |
( |
const Device & |
device | ) |
|
Send a secret key to given device.
- Parameters
-
◆ impl_
Pointer<SecretKeyImpl> HEaaN::SecretKey::impl_ |
|
private |
The documentation for this class was generated from the following file: