mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04:00
2.3 KiB
2.3 KiB
module concrete.compiler.tfhers_int
Import and export TFHErs integers into Concrete.
class TfhersExporter
A helper class to import and export TFHErs big integers.
method export_int
export_int(value: TransportValue, info: TfhersFheIntDescription) → bytes
Convert Concrete value to TFHErs and serialize it.
Args:
value(Value): value to exportinfo(TfhersFheIntDescription): description of the TFHErs integer to export to
Raises:
TypeError: if wrong input types
Returns:
bytes: converted and serialized TFHErs integer
method import_int
import_int(
buffer: bytes,
info: TfhersFheIntDescription,
keyid: int,
variance: float,
shape: Tuple[int, ]
) → TransportValue
Unserialize and convert from TFHErs to Concrete value.
Args:
buffer(bytes): serialized TFHErs integerinfo(TfhersFheIntDescription): description of the TFHErs integer to importkeyid(int): id of the key used for encryptionvariance(float): variance used for encryptionshape(Tuple[int, ...]): expected shape
Raises:
TypeError: if wrong input types
Returns:
TransportValue: unserialized and converted value