KVStore

This document describes the KVStore type provided by the High-level API.

The KVStore is a storage type that associates keys to values, similar to a hash table. In the KVStore, the keys are clear numbers, and values are encrypted numbers such as FheUint or FheInt.

Clear-key operations

The KVStore supports operations where the queried key is clear. These operations are inexpensive and efficient to perform.

  • insert_with_clear_key - insert or replace a key-value pair

  • update_with_clear_key - update the value associated to an existing key

  • remove_with_clear_key - remove an existing key-value pair

  • get_with_clear_key - get the value associated to a key

Encrypted-key operations

The KVStore also supports doing queries using an encrypted key.

  • get - get the value associated to a key

  • update - update the value associated to an already existing key

  • map - update the value associated to an already existing key, by computing a function on it. This is faster than doing get, then update.

Encrypted-key operations do not support inserting or removing key-value pairs.

Serialization

To serialize a KVStore, it must first be compressed.

Last updated

Was this helpful?