Files
concrete/docs/dev/api/concrete.compiler.tfhers_int.md
2024-12-24 14:08:08 +01:00

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 export
  • info (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 integer
  • info (TfhersFheIntDescription): description of the TFHErs integer to import
  • keyid (int): id of the key used for encryption
  • variance (float): variance used for encryption
  • shape (Tuple[int, ...]): expected shape

Raises:

  • TypeError: if wrong input types

Returns:

  • TransportValue: unserialized and converted value