-
Notifications
You must be signed in to change notification settings - Fork 287
Description
What is the problem you want to solve and can not with the current version?
Currently, tfhe-rs supports basic operations on integers such as arithmetic, bitwise operations, comparisons, and min/max comparison. I propose this project to extend these existing primitives to more complicated integer operations in areas such as number theory. With this addition to tfhe-rs, users can abstract away functions they would have needed to implement themselves and focus on building meaningful projects. Further, this project aims to ensure its functions are high-speed and reliable.
Describe the solution you'd like
An extension of tfhe-rs with more functions similar to Rust's BigInt library.
Describe alternatives you've considered
Writing my own functions using already existing primitive operations (addition, multiplication, etc..)
Additional context
A few examples of functions to be added are the following:
- nth_root
- modinv
- modpow
- gcd
- lcm
- divides
- is_multiple_of
- is_even/odd
- next/prev_multiple_of
- median
- approx_log
These functions will leverage the already existing implementations of basic arithmetic. They would be added for both FheUint and FheInt.
Related links/References:
Python Math Library
Sage Integer Arithmetic
GNU Exponentiation and Logarithms
Rust num-bigint
ruint
I am happy to work on this project and discuss it further.