Class containing functions dealing with message/plaintext encoding and decoding.
More...
#include <EnDecoder.hpp>
Class containing functions dealing with message/plaintext encoding and decoding.
◆ EnDecoder()
HEaaN::EnDecoder::EnDecoder |
( |
const Context & |
context | ) |
|
|
explicit |
◆ decode()
Decode a plaintext into a message.
- Parameters
-
- Returns
- Decoded message.
◆ encode() [1/2]
Encode a message into a plaintext with the maximal supported level of the current context.
- Parameters
-
- Returns
- Encoded plaintext.
Encode to the default encryption level.
- Exceptions
-
RuntimeException | if neither the size of the input message is a power of two, nor it exceeds one half of the ciphertext dimension of the current homomorphic encryption context. |
◆ encode() [2/2]
Encode a message into a plaintext at a certain level at a certain rescale counter.
- Parameters
-
[in] | msg | Input message |
[in] | level | Target level to which msg is to be encoded |
[in] | r_counter | Target rescale counter to which msg is to be encoded |
- Returns
- Encoded plaintext.
All the real and imaginary parts of the slot values in msg
should not exceed 2^(64). The output plaintext is in NTT form, which can be directly used in polynomial multiplication. The size of msg
should be a power of two, being less than or equal to half of the dimension of the current context.
- Exceptions
-
RuntimeException | if neither the size of the input message is a power of two, nor it exceeds one half of the ciphertext dimension of the current homomorphic encryption context. |
RuntimeException | if the target level exceeds the maximal level decided in the homomorphic encryption context. |
RuntimeException | if the target rescale counter exceeds the target level . |
◆ encodeWithoutNTT() [1/2]
Encode a message into a plaintext with the maximal supported level of the current context, without performing NTT.
- Parameters
-
- Returns
- Encoded plaintext.
- Exceptions
-
RuntimeException | if neither the size of the input message is a power of two, nor it exceeds one half of the ciphertext dimension of the current homomorphic encryption context. |
◆ encodeWithoutNTT() [2/2]
Plaintext HEaaN::EnDecoder::encodeWithoutNTT |
( |
const Message & |
msg, |
|
|
u64 |
level, |
|
|
int |
r_counter = 0 |
|
) |
| const |
Encode a message into a plaintext at a certain level at a certain rescale counter, without performing NTT.
- Parameters
-
[in] | msg | Input message. |
[in] | level | Target level to which the input msg is to be encoded. |
[in] | r_counter | Target rescale counter to which msg is to be encoded |
- Returns
- Encoded plaintext.
- Exceptions
-
RuntimeException | if neither the size of the input message is a power of two, nor it exceeds one half of the ciphertext dimension of the current homomorphic encryption context. |
RuntimeException | if the target level exceeds the maximal level decided in the homomorphic encryption context. |
RuntimeException | if the target rescale counter exceeds the target level |
◆ context_
const Context HEaaN::EnDecoder::context_ |
|
private |
A context with which the scheme is associated.
The documentation for this class was generated from the following file: