Skip to content
YUENIX-FHEContact
Preview documentation. The YUENIX-FHE 1.0 API is in development and names or signatures may change before release. Request an evaluation

Python API

The yuenix package wraps the C ABI. It accepts and returns NumPy arrays. Every object is a context manager that frees its native handle on exit.

import yuenix
Member Description
plan(profile, rotations=(), program=None) -> Plan profile is a yuenix.Profile, a JSON dict, or JSON bytes
synchronize() Wait for queued GPU work
import_evaluator(plan, data: bytes) -> Evaluator Evaluator from serialized keys
load_ciphertext(plan, data: bytes) -> Ciphertext
Member Description
capabilities slots, input_level, output_level, program limits
generate_keys() -> Keyset
Member Description
evaluator() -> Evaluator Same-process evaluator
export_evaluation_keys() -> bytes
encrypt(values, level=None) -> Ciphertext values: real or complex array
decrypt(ct) -> numpy.ndarray[complex128]
register_aes_key(client, key: bytes) 16-byte AES-128 key
admit(obj) Verify GCM authentication for a transciphered result
decrypt_vector(result) -> numpy.ndarray[float64]

Arithmetic: add, sub, mul, add_scalar, mul_scalar, rotate, conjugate, bootstrap, apply_function. Each accepts out= to reuse a ciphertext.

Comparison: compare, less_than, min, max, argmax, rank, topk_mask, sort.

Aggregation and transciphering: vectors(rows, dimensions, cipher=...) -> Vectors, transcipher(client, record).

Member Description
level Current level
serialize() -> bytes

Failures raise yuenix.Error, which carries .status (a yuenix.Status value) and the library message. Authentication failures raise yuenix.AuthenticationError, a subclass of yuenix.Error.