Commit Graph

1041 Commits

Author SHA1 Message Date
tmontaigu
5b653864b7 chore(tfhe): bump version to 0.5.2 tfhe-rs-0.5.2 2024-02-23 10:21:47 +01:00
Arthur Meyre
a1d189b415 chore(ci): update macOS runner for cargo builds 2024-02-23 10:21:47 +01:00
sarah el kazdadi
c59434f183 chore(ci): update toolchain, fix clippy warnings 2024-02-23 10:21:47 +01:00
David Testé
83239e6afa chore(bench): implement integer casting benchmarks 2024-02-23 10:21:47 +01:00
sarah el kazdadi
ef8cb0273f fix(tfhe): update pulp and bytemuck to fix nightly breakage 2024-02-23 10:21:47 +01:00
tmontaigu
9b353bac2d fix(integer): correct degree in small comparisons 2024-02-23 10:21:47 +01:00
tmontaigu
46d65f1f87 fix(capi): add missing function on FheBool
- safe ser/de
- classical ser/de
- comparisons
- scalar binary fn/comparisons
- compact & compressed fhe bool encryption
2024-02-23 10:21:47 +01:00
tmontaigu
a63a2cb725 chore(hlapi): add tests for fhe_bool 2024-02-23 10:21:47 +01:00
tmontaigu
c45af05ec6 fix(integer): make encrypt_bool specify the degree
encrypt_one_block does not leak information
on the message.
BooleanBlocks are meant for when we want to
be explicit that the value is a boolean
and are ok for this to be public.

Thus it needs to correctly set the degree to 1
for other operations to properly take advantage of that
2024-02-23 10:21:47 +01:00
tmontaigu
584eaeb4ed fix(shortint): fix bitwise opts degree
We used `after_bitand/or/xor` on the ct_left
**after** the lut had changed its degree.
So the `after_bit` function computed the
resulting using a wrong degree for the left
ct.
2024-02-23 10:21:47 +01:00
tmontaigu
8d94ed2512 fix(hlapi): bind missing cuda bitnot 2024-02-23 10:21:47 +01:00
tmontaigu
b8d9dbe85b refactor(hlapi): split long files of hlapi
This splits the long base.rs files into multiple ones,
to make it easier to navigate.

There is no code changes appart from moving stuff.
2024-02-23 10:21:47 +01:00
tmontaigu
ad25340c33 feat(capi): add Cuda support
- This adds GPU support in the C API
- Also make ctest (cmake test launcher) print
  test output when it fails
2024-02-23 10:21:47 +01:00
Arthur Meyre
ad1ae0c8c2 chore(ci): update scripts and Makefile for future forward compatibility 2024-01-31 18:22:15 +01:00
Arthur Meyre
ee40906b8b chore(ci): convert some make targets to be semver trick compatible 2024-01-31 18:22:15 +01:00
Arthur Meyre
bf6b4cc541 chore(tfhe): bump version to 0.5.1 tfhe-rs-0.5.1 tfhe-cuda-backend-0.1.3 2024-01-30 10:51:39 +01:00
Arthur Meyre
24404567a4 chore(tfhe): bump tfhe-cuda-backend version to 0.1.3 2024-01-30 10:51:39 +01:00
tmontaigu
052dd4a60e feat(integer): fuse two PBS in comparisons
In comparisons, we were reducing a vec of orderings
(inferior, equal, superior) into one final ordering,
and then we would do one final PBS to transform that
into a boolean value (0 or 1) depending what was wanted
(<=, <, >, >=).

This fuse the last PBS (ordering -> boolean value) with
the last round of reduction, when there are only two blocks left
to be reduced.

This allows to gain one PBS. Meaning for ciphertext/cipheretxt
comparisons we get back the performance lost introduced by
the fix in f4c220c1. And comparisons between a clear and
ciphertext get an improvement.
2024-01-30 10:51:39 +01:00
tmontaigu
f8d829d076 fix(integer): add noise cleaning pbs in comparisons
In comparisons we were packing blocks to then do a subtraction
between them. However this goes above the noise limit
that would guarentee the advertised error propability.

To fix that we add a pbs to clean the noise. This pbs only needs
to be added in the ciphertext/ciphertext comparisons. Making them slower
by 1 PBS.
2024-01-30 10:51:39 +01:00
dependabot[bot]
d9761ca17e chore(deps): bump codecov/codecov-action from 3.1.4 to 3.1.5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](eaaf4bedf3...4fe8c5f003)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
dependabot[bot]
8d2e15347b chore(deps): bump tj-actions/changed-files from 42.0.0 to 42.0.2
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 42.0.0 to 42.0.2.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](ae82ed4ae0...90a06d6ba9)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
dependabot[bot]
a368257bc7 chore(deps): bump actions/upload-artifact from 4.1.0 to 4.3.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.1.0 to 4.3.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.1.0...26f96dfa697d77e81fd5907df203aa23a56210a8)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
David Testé
76d23d0c91 chore(bench): add ciphertexts sum to integer benchmarks 2024-01-30 10:51:39 +01:00
David Testé
ddc5002232 chore(bench): add pbs benchmarks on gpu 2024-01-30 10:51:39 +01:00
tmontaigu
c08c479616 docs(hlapi): document trivial encryption to debug 2024-01-30 10:51:39 +01:00
tmontaigu
f26afc16de docs(hlapi): document how to use rayon 2024-01-30 10:51:39 +01:00
yuxizama
13f533f6fb chore(docs): update readme links and badges 2024-01-30 10:51:39 +01:00
yuxizama
d9541e472b chore(docs): update README.md
Change support banner
2024-01-30 10:51:39 +01:00
Agnes Leroy
3453e45258 fix(gpu): make all async functions unsafe, fix cuda_drop binding, add missing sync 2024-01-30 10:51:39 +01:00
David Testé
55de96f046 chore(ci): add gpu tests from user documentation 2024-01-30 10:51:39 +01:00
Agnes Leroy
9747c06f6e chore(gpu): fix formatting command 2024-01-30 10:51:39 +01:00
Agnes Leroy
00f72d2c13 chore(gpu): fix compilation when no nvidia gpu is available 2024-01-30 10:51:39 +01:00
tmontaigu
01f5cb9056 fix(integer): is_scalar_out_of_bounds handles bigger ct
Fix a bug where in is_scalar_out_of_bounds, if the scalar was
negative and the ciphertext a signed one with more blocks than
the decomposed scalar, we would do an out of bound access
(i.e a panic).

This fixes that, this will fix doing signed_overflowing_mul on 256 bits
where the bug first appeared
2024-01-30 10:51:39 +01:00
David Testé
d66e313fa4 chore(ci): fix inputs for gpu full benchmark workflow 2024-01-30 10:51:39 +01:00
Arthur Meyre
c9d530e642 fix(core): ignore value in the body when doing LWE encryption 2024-01-30 10:51:39 +01:00
Agnes Leroy
6c2096fe52 chore(gpu): rename "test vector" -> "luts" and "tvi" -> "lut_indexes" 2024-01-30 10:51:39 +01:00
Agnes Leroy
1e94134dda chore(gpu): move around code in integer.h for better readability 2024-01-30 10:51:39 +01:00
tmontaigu
c76a60111c fix(integer): fix cast in scalar_shift/rotate
In scalar_shift/rotate, we get the number of bits to shift/rotate
as a generic type, the can be casted to u64.

We compute the total number of bits the ciphertext has, cast that number
to the same type as the scalar, and do "shift % num_bits".

However, if the number of bits computed exceeds the max value the scalar
type can hold, we could end up doing a remainder with 0.

e.g 256bits ciphertext and scalar type u8 => 256u64 casted to u8 results
in 0.

Fix that by casting the scalar value to u64.
2024-01-30 10:51:39 +01:00
tmontaigu
18ff400df2 chore(hlapi): remove leftover file
This file was not correctly removed during the refactor
2024-01-30 10:51:39 +01:00
David Testé
3d31d09be5 chore(ci): change rust-toolchain action
Github thrid-party Action actions-rs/toolchain is not maintained
anymore. We switch to dtolnay/rust-toolchain.
2024-01-30 10:51:39 +01:00
David Testé
76322606f2 chore(ci): set rustbacktrace var to full to ease debug on failure 2024-01-30 10:51:39 +01:00
dependabot[bot]
bf58a9f0c6 chore(deps): bump actions/upload-artifact from 3.1.2 to 4.2.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.2 to 4.2.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.2...694cdabd8bdb0f10b2cea11669e1bf5453eed0a6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
dependabot[bot]
64461c82b4 chore(deps): bump tj-actions/changed-files from 41.1.1 to 42.0.0
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 41.1.1 to 42.0.0.
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](62f4729b5d...ae82ed4ae0)

---
updated-dependencies:
- dependency-name: tj-actions/changed-files
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
dependabot[bot]
339c84fbd9 chore(deps): bump actions/checkout from 3.5.3 to 4.1.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 4.1.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3.5.3...b4ffde65f46336ab88eb53be808477a3936bae11)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-30 10:51:39 +01:00
Arthur Meyre
bc682a5ffb docs(bench): add scalar benchmarks for integer 2024-01-29 16:42:32 +01:00
Arthur Meyre
2920daf2d9 chore(docs): fix link to 0.4 semver doc 2024-01-23 10:50:25 +01:00
Arthur Meyre
e7352eee8b chore(tfhe): add version for tfhe-cuda-backend dependency tfhe-rs-0.5.0 2024-01-22 17:24:51 +01:00
J-B Orfila
33a7e9f3e4 doc(gpu): add how to page about running on GPU tfhe-cuda-backend-0.1.2 2024-01-22 17:18:02 +01:00
David Testé
96da25ce90 chore(ci): separate clippy and tests in different job steps 2024-01-22 16:04:07 +01:00
Agnes Leroy
548f2e5d05 chore(gpu): fix gpu package for publication 2024-01-22 15:29:26 +01:00