xtrace_sdk.x_vec.crypto.hamming_client_base¶
Classes¶
Abstract base class for homomorphic encryption clients used in encrypted Hamming distance search. |
Module Contents¶
- class xtrace_sdk.x_vec.crypto.hamming_client_base.HammingClientBase¶
Bases:
abc.ABCAbstract base class for homomorphic encryption clients used in encrypted Hamming distance search.
Concrete implementations (
PaillierClient,PaillierLookupClient) encrypt binary embedding vectors on the client side, send the ciphertexts to XTrace, and later decrypt the encoded Hamming distances returned by the server — without the server ever seeing plaintext vectors or distances.- abstractmethod encrypt_vec_one(embd)¶
Encrypt a single binary embedding vector.
- abstractmethod encrypt_vec_batch(embds)¶
Encrypt a batch of binary embedding vectors.
- abstractmethod decode_hamming_client_one(cipher)¶
Decrypt a single encrypted Hamming distance returned by the XTrace server.
- abstractmethod decode_hamming_client_batch(ciphers)¶
Decrypt a batch of encrypted Hamming distances returned by the XTrace server.