CopyAndRecurseDatabase#
Currently, this API is unsupported in Python
-
class CopyAndRecurseDatabase#
A class for a queryable encrypted database.
Public Functions
-
CopyAndRecurseDatabase(const HeContext &he)#
Construct a new CopyAndRecurseDatabase object.
- Parameters:
he – The HeContext.
-
void init(const std::vector<uint16_t> &database, int numChildren, bool binary = false)#
Initializes this CopyAndRecurseDatabase object with data.
- Parameters:
database – The plain database.
numChildren – The number of children of every internal node in the partition trees data structure of this CopyAndRecurseDatabase.
binary – Whether to encrypt the values of the database in binary representation.
-
void setCompareMethod(std::function<CTile(const CTile&, const CTile&)> compare)#
Sets the comparison method to use.
- Parameters:
compare – The comparison method to use.
Sets the comparison method to use when running in binary representation mode.
- Parameters:
compare – The comparison method to use.
-
CopyAndRecurseDatabase::Range encryptRange(double start, double end) const#
Encrypts a range to use in a query over a CopyAndRecurseDatabase object.
- Parameters:
start – start of range.
end – end of range.
- Throws:
runtime_error – if the CopyAndRecurseDatabase was initialized in binary representation mode, and the given range values are not integers.
- Returns:
A Range object.
-
void countQuery(CTile &res, const CopyAndRecurseDatabase::Range &range)#
Performs a count query.
Returns an encryption of the number of elements contained within the given encrypted range.
- Parameters:
res – The output result.
range – The range to query.
-
void emptinessQuery(CTile &res, const CopyAndRecurseDatabase::Range &range)#
Performs an emptiness query.
Returns an encryption of an indicator which indicates whether the given encrypted range is empty or not.
- Parameters:
res – The output indicator result.
range – The range to query.
-
inline void setVerbosity(Verbosity verbosity)#
Sets the verbosity.
- Parameters:
verbosity – The verbosity level.
-
int getNumUsedTiles() const#
Gets the number of used tiles in this CopyAndRecurseDatabase object.
-
class Range#
-
CopyAndRecurseDatabase(const HeContext &he)#