HEaaN
Crypto Lab's great homomorphic encryption library
include
HEaaN
Plaintext.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/Integers.hpp
"
16
#include "
HEaaN/Pointer.hpp
"
17
#include "
HEaaN/device/Device.hpp
"
18
19
namespace
HEaaN
{
20
class
PlaintextImpl;
21
class
Polynomial;
22
26
class
HEAAN_API
Plaintext
{
27
public
:
28
explicit
Plaintext
(
const
Context
&context);
29
32
void
setLogSlots(
u64
log_slots);
33
36
u64
getLogSlots()
const
;
37
40
u64
getNumberOfSlots()
const
;
41
43
Polynomial &getMx();
44
46
const
Polynomial &getMx()
const
;
47
50
u64
*getMxData(
u64
i)
const
;
51
53
void
save
(
const
std::string &path)
const
;
54
56
void
save
(std::ostream &stream)
const
;
57
59
void
load
(
const
std::string &path);
60
62
void
load
(std::istream &stream);
63
66
int
getRescaleCounter()
const
;
67
69
void
setRescaleCounter(
int
r_counter);
70
73
u64
getLevel()
const
;
74
77
void
setLevel(
u64
level);
78
81
const
Device
&getDevice()
const
;
82
85
void
to(
const
Device
&device);
86
89
void
allocate(
const
Device
&device);
90
92
bool
isZero()
const
;
93
94
private
:
95
Pointer<PlaintextImpl>
impl_
;
96
};
97
98
}
// namespace HEaaN
HEaaN::load
HEAAN_API void load(EvaluationKey &key, std::istream &stream)
Load key from a given stream.
HEaaN::Pointer< PlaintextImpl >
Device.hpp
HEaaN::u64
std::uint64_t u64
Definition:
Integers.hpp:17
Pointer.hpp
HEaaN::Plaintext
A class of plaintexts each of which is simply a polynomial.
Definition:
Plaintext.hpp:26
HEaaN::Device
Definition:
Device.hpp:33
HEaaN::Plaintext::impl_
Pointer< PlaintextImpl > impl_
Definition:
Plaintext.hpp:95
Integers.hpp
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
Generated by
1.8.17