CtxtCacheMem#
Currently, this API is unsupported in Python
-
class CtxtCacheMem : public helayers::circuit::CtxtCache#
This class is a special case of CtxtCache where the ciphertexts are all stored in the RAM.
Public Functions
-
virtual void encrypt() override#
Encrypt all the parameters (that are given in plaintext).
- Parameters:
he – The context to encrypt with.
-
virtual bool hasIdReady(const NodeId &id) const override#
Return whether a ctxt given by ID is currently ready in memory.
- Parameters:
id – The id of a ctxt.
- Returns:
true if the cache has the id ready in memory.
Return the tile associated with an ID.
- Parameters:
out – The output tile.
id – The id of a ctxt.
- Returns:
The cache information of the source cache of the tile. In the case of a cache miss, the source cache is considered to be the one from which the tile was brought.
Return the tile (ctxt or ptxt) associated with an ID.
- Parameters:
out – The output tile.
id – The id of a tile.
- Returns:
The cache information of the source cache of the tile. In the case of a cache miss, the source cache is considered to be the one from which the tile was brought.
-
virtual void merge(CtxtCache &c) override#
Merge the content of another cache into this cache.
Equal keys are assumed to hold equal values, values given to these keys are ignored.
- Parameters:
c – The cache to merge into this cache. After this function c is cleared.
Set a ctxt and associate it with an ID.
The tile pointer is copied so the cache and the caller both point to the same tile.
- Parameters:
id – The id of the ctxt.
- Throws:
runtime_error – if the id already exists in the cache.
-
virtual void setByIdCopy(const NodeId &i, const Tile &c) override#
Set a ctxt and associate it with an ID.
The Tile is copied into the cache.
- Parameters:
id – The id of the ctxt.
- Throws:
runtime_error – if the id already exists in the cache.
-
virtual void setByIdMove(const NodeId &i, Tile &&c) override#
Set a ctxt and associate it with an ID.
The function uses std::move which empties the input ctxt.
- Parameters:
id – The id of the ctxt.
- Throws:
runtime_error – if the id already exists in the cache.
-
virtual void setPtxtById(const NodeId &i, PTile &&c) override#
Set a ptxt and associate it with an ID.
The function uses std::move which empties the input ptxt.
- Parameters:
id – The id of the ptxt.
- Throws:
runtime_error – if the id already exists in the cache.
-
virtual void removeById(const NodeId &i) override#
Remove a ctxt from memory.
- Parameters:
id – The id of ctxt.
-
virtual bool hasByLabel(const NodeLabel &i) const override#
Return whether a ctxt given by label is associated with this cache.
- Parameters:
label – The label of ctxt.
- Returns:
Whether the ctxt with this label is associated with this cache.
-
inline virtual bool isReadyByLabel(const NodeLabel &i) const override#
Return whether a ctxt given by label is currently ready in memory.
- Parameters:
label – The label of the ctxt.
- Returns:
Whether the ctxt is ready in memory.
Set a ctxt and associate it with a label.
- Parameters:
label – The label of the ctxt.
-
virtual void translateLabelsToIds(const std::map<NodeLabel, NodeId> &map) override#
Provide a map that translates labels to IDs.
- Parameters:
map – The map that translates labels to IDs.
-
virtual std::vector<NodeId> getCtxtIdsInMemory() const override#
Get the list of ids that are currently in memory.
- Returns:
The list of ids of ctxts that are currently in memory.
-
virtual void debugPrint(const std::string&, Verbosity, std::ostream&) const override#
Prints the content of this object.
- Parameters:
title – Text to add to the print
verbosity – Verbosity level
out – Output stream
-
inline virtual CacheType getCacheType() const override#
Return the cache type of this CtxtCache.
-
virtual void encrypt() override#