TFHE-rs Interoperability
Overview
Encoding differences
from concrete.fhe import tfhers
# don't worry about the API, we will have better examples later.
# we just want to show the encoding here
tfhers_params = tfhers.CryptoParams(
lwe_dimension=909,
glwe_dimension=1,
polynomial_size=4096,
pbs_base_log=15,
pbs_level=2,
lwe_noise_distribution=9.743962418842052e-07,
glwe_noise_distribution=2.168404344971009e-19,
encryption_key_choice=tfhers.EncryptionKeyChoice.BIG,
)
# TFHERSInteger using this type will be represented as a vector of 8/2=4 integers
tfhers_type = tfhers.TFHERSIntegerType(
is_signed=False,
bit_width=8,
carry_width=3,
msg_width=2,
params=tfhers_params,
)
assert (tfhers_type.encode(123) == [3, 2, 3, 1]).all()
assert tfhers_type.decode([3, 2, 3, 1]) == 123Parameter match
Scenarios
Serialization of ciphertexts and keys
Last updated
Was this helpful?