Commit Graph

33 Commits

Author SHA1 Message Date
Nicolas Sarlin
4c8d55f32b chore(zk): add bench zk v1 vs v2 2025-01-10 15:47:25 +01:00
Nicolas Sarlin
9ac89fc6bf fix(bench): use correct name for parameters in wasm benches 2025-01-08 13:23:14 +01:00
Nicolas Sarlin
8ee1bdd9a9 chore(shortint): update classic gaussian param 2025-01-07 12:02:09 +01:00
Arthur Meyre
3a99ee9718 chore: remove aliases for gaussian parameters for compact PK
- we are TUniform by default so no more aliases for gaussian parameters
2024-12-16 09:50:12 +01:00
Nicolas Sarlin
6ef22e8cb9 refactor(zk)!: directly use the CompactPkeCrs in all public APIs
BREAKING_CHANGE:
- All the zk API (build_with_proof, verify, verify_and_expand,...) now take a
`CompactPkeCrs` instead of a `CompactPkePublicParams`. Serialized
`CompactPkePublicParams` from previous versions can be converted into a
`CompactPkeCrs` using `params.into()`
2024-11-08 17:50:34 +01:00
Arthur Meyre
f497bf09a3 chore(ci): fix wasm bench parameter names 2024-10-25 16:52:22 +02:00
Arthur Meyre
199cb6714a chore(all): remove default big/small configurations 2024-10-25 14:54:16 +02:00
Nicolas Sarlin
7c295947dd fix(wasm): fix size used for serialization in benches 2024-10-22 16:45:26 +02:00
Nicolas Sarlin
3b4f0d20f1 feat(wasm): export safe_deserialize for CompactPkePublicParams 2024-10-22 13:36:52 +02:00
Arthur Meyre
81d82bc45c chore(bench): bench 64 bits for ZKs 2024-09-26 20:16:22 +02:00
Arthur Meyre
43d91f512f chore(ci): use python as webdriver for wasm test and benchmarks
Swtich from Jest and Puppeteer to Python with Selenium. It relies
on browser and webdriver binaries from browser fabricators.
For now the Python script only supports Chrome browser.
2024-09-25 09:11:13 +02:00
Arthur Meyre
0e6423820f feat(tfhe): add possibility to expand a ciphertext without verifying it 2024-09-13 14:59:21 +02:00
Arthur Meyre
0612ef5be5 feat(integer): plug metadata into lower level ZK APIs 2024-09-11 18:06:25 +02:00
Arthur Meyre
26055b236e feat(tfhe): allow unpacking packed compact ciphertext lists in js/wasm 2024-09-06 14:19:07 +02:00
Arthur Meyre
8f10f8f8db chore(ci): reduce bench loops for WASM compressed server key
- excessive loops seemed to trigger a crash likely due to some memory
exhaustion/fragmentation
2024-08-14 13:42:14 +02:00
Arthur Meyre
9242b2a725 feat(high_level_api): add casting primitives for compact public key 2024-06-20 13:24:27 +02:00
David Testé
4c8d791a2d chore(bench): measure object sizes in zk_pke benchmarks 2024-06-19 10:51:03 +02:00
Arthur Meyre
75e2be2ca2 chore(bench): update zk wasm benchmarks
- add a parameter set for wasm to benchmark relevant ZK timings
- update benchmarking code to be more flexible
2024-06-19 10:51:03 +02:00
Arthur Meyre
65737e83db refactor(HL): disallow unpacked ZK proofs in the HL API and WASM API
- ZK timings being bad, we make the decision to always pack for ZKs
2024-06-19 10:51:03 +02:00
David Testé
2bd9f7aab4 chore(shortint): remove compact pk t-uniform parameters set
Add new TUniform under classic/ that is not compact public key.
2024-06-17 16:33:32 +02:00
David Testé
179fbfc9bb chore(shortint): update default parameters
The default parameters are now offering a security level of 132
bits and uses a p-fail of 2**-64.
2024-06-12 17:22:24 +02:00
tmontaigu
3f9c1b0ca6 refactor(tfhe): Allow CompactCiphertextList to store heterogeneous types
This refactors the integer's CompactCiphertextList to allow storing
unsigned, signed (without necessarily the same number of blocks) and
booleans in a single comapct list.

This is better as its more flexible and allows for better compression
by not forcing to use a list per data type. This is especially
interessing with zero-knowledge proofs as they are expensive to compute.

This also adds the ability to pack integer blocks by using the carry
space, but makes the expansion require a ServerKey to split blocks
via PBS.

BREAKING CHANGE: expand method from CompactCiphertextList returns a
                 CiphertextExpander
BREAKING CHANGE: Removes 'typed' CompactList and Compact types from the hlapi
                 (e.g. CompactFheUintList/CompactFheUintX)
2024-06-06 17:26:13 +02:00
Arthur Meyre
c807bce207 chore(tfhe): update ZK related parameters to use TUniform ones 2024-04-09 13:27:19 +02:00
tmontaigu
2c106e8f01 feat(tfhe): plug zk-pok into all layers 2024-04-09 07:59:20 +02:00
David Testé
9efe4ac69e chore(ci): format javascript code using prettier 2024-03-14 09:22:26 +01:00
David Testé
b40897adbe chore(bench): benchmark server keys with wasm
Benchmarks are run for 1_1 and 2_2 parameters set on compressed
server key.
2024-03-14 09:22:26 +01:00
tmontaigu
ec27d3dc6f refactor(hlapi): remove wrapping of booleans
This commit removes the wrapping of the `tfhe::boolean`
that was done in the HLAPI, effectively making the HLAPI
only wrapping `tfhe::integer`.

FheBool is now reused to be a single shortint block
compatible with other type FheUint8,16,etc (previously they were not).

In the future, `tfhe::boolean` could be re-wrapped in hlapi, but
this time, to be used as a base for all integers and not just
FheBool.

BREAKING CHANGE:
- hlapi no longer wraps tfhe::boolean API.
- tfhe::ConfigBuilder::enable_bool/disable_bool/all_disabled/all_enabled
  removed. Now default configuration should be done using
  `tfhe::ConfigBuilder::default()`.
- `tfhe::ConfigBuilder::use_default_small_integer` removed
  use `tfhe::CondifBuilder::default_with_small_encryption()`
- Uninitialied{ClientKey, PublicKey, CompressedPublicKey} error types
  removed as these erros are no longer possible
2023-11-04 00:18:16 +01:00
Arthur Meyre
b09dc1f3ca chore(tfhe): rename params 2023-06-28 19:14:20 +02:00
J-B Orfila
a8e8a2e555 chore(shortint): update param compact key 2023-06-28 19:14:20 +02:00
Arthur Meyre
9e307a8945 chore(hlapi): add example to measure CPK and CCTL sizes
This also includes key generation time in WASM web client side
2023-06-12 11:41:21 +02:00
Arthur Meyre
3508019cd2 feat(core): Add Compact Public Key
- Based on "TFHE Public-Key Encryption Revisited "
  https://eprint.iacr.org/2023/603.pdf

Co-authored-by: tmontaigu <thomas.montaigu@laposte.net>
2023-06-07 19:47:50 +02:00
tmontaigu
8a1691c536 chore(wasm): remove serialization in web test
In the web wasm test we serialize the public key
to print its size (38_931_6265 bytes) this
means we hold the public key twice in ram.

I suspect this causes frequent out of
memory errors which then result in the
test timing out.

So we remove that hoping it has a positive impact
2023-06-02 17:19:04 +02:00
tmontaigu
d4ff1f5595 feat(wasm): add parralellism in wasm API and add wasm for HLAPI
Co-authored-by: David Testé <david.teste@zama.ai>
2023-06-02 11:13:12 +02:00