Skip to content

Commit

Permalink
feat(frontend/backend): support TFHErs tensors
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Nov 7, 2024
1 parent 67895a1 commit f788102
Show file tree
Hide file tree
Showing 9 changed files with 586 additions and 138 deletions.
14 changes: 9 additions & 5 deletions backends/concrete-cpu/implementation/include/concrete-cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,14 @@ void concrete_cpu_keyswitch_lwe_ciphertext_u64(uint64_t *ct_out,
size_t concrete_cpu_lwe_array_to_tfhers_int8(const uint64_t *lwe_vec_buffer,
uint8_t *buffer,
size_t buffer_len,
struct TfhersFheIntDescription fheint_desc);
size_t n_elem,
struct TfhersFheIntDescription desc);

size_t concrete_cpu_lwe_array_to_tfhers_uint8(const uint64_t *lwe_vec_buffer,
uint8_t *buffer,
size_t buffer_len,
struct TfhersFheIntDescription fheuint_desc);
size_t n_elem,
struct TfhersFheIntDescription desc);

size_t concrete_cpu_lwe_ciphertext_size_u64(size_t lwe_dimension);

Expand Down Expand Up @@ -418,16 +420,18 @@ size_t concrete_cpu_serialize_lwe_secret_key_u64(const uint64_t *lwe_sk,
uint8_t *out_buffer,
size_t out_buffer_len);

size_t concrete_cpu_tfhers_fheint_buffer_size_u64(size_t lwe_size, size_t n_cts);
size_t concrete_cpu_tfhers_fheint_buffer_size_u64(size_t lwe_size, size_t n_cts, size_t n_elem);

int64_t concrete_cpu_tfhers_int8_to_lwe_array(const uint8_t *serialized_data_ptr,
size_t serialized_data_len,
int64_t concrete_cpu_tfhers_int8_to_lwe_array(const uint8_t *buffer,
size_t buffer_len,
uint64_t *lwe_vec_buffer,
size_t n_elem,
struct TfhersFheIntDescription desc);

int64_t concrete_cpu_tfhers_uint8_to_lwe_array(const uint8_t *buffer,
size_t buffer_len,
uint64_t *lwe_vec_buffer,
size_t n_elem,
struct TfhersFheIntDescription desc);

size_t concrete_cpu_tfhers_unknown_noise_level(void);
Expand Down
Loading

0 comments on commit f788102

Please sign in to comment.