Skip to content

[do not merge] Lattice-based IBE#251

Draft
jonas-lj wants to merge 13 commits into
mainfrom
jonas/pqibe
Draft

[do not merge] Lattice-based IBE#251
jonas-lj wants to merge 13 commits into
mainfrom
jonas/pqibe

Conversation

@jonas-lj

@jonas-lj jonas-lj commented Aug 25, 2025

Copy link
Copy Markdown
Collaborator

Description

Adds Falcon-512 lattice-based IBE as a post-quantum alternative to the existing Boneh-Franklin BLS12-381 scheme, implementing the PQ-TSS-BF-KEM protocol. The threshold secret-sharing layer is unchanged; only the per-share IBE encapsulation is swapped.

What's included

  • New IBEEncryptions::Falcon512, IBEPublicKeys::Falcon512, IBEUserSecretKeys::Falcon512 variants.
  • seal_encrypt / seal_decrypt Falcon paths.
  • Deterministic per-share randomness: a single global seed r is sampled once; every share's lattice randomness (k, r_i, e1, e2) is derived via Hash(r, i, A_i, H(ID)). c_r = r XOR k_r is stored as encrypted_randomness.
  • Share-consistency verification (decrypt_all_shares_and_verify_nonce Falcon arm): recovers r, re-derives each share's randomness, recomputes the share via w XOR H(k), and re-encrypts to verify the ciphertext matches. Tampering with (u, v) is caught directly; tampering with w is caught by the polynomial-consistency check.
  • Falcon arm for seal-cli's Display.

Protocol conformance

Every step of PQ-TSS-BF-KEM Encrypt/Decrypt is implemented, including the final ciphertext-verification assertion. One known structural divergence (pre-existing): the underlying primitive uses a Fujisaki-Okamoto-style mask (w = share XOR H(k), random k) rather than the protocol's direct bit-encoding. Functionally equivalent for transport; verification works under either. Reconciling the encoding is tracked separately and would live in fastcrypto-lattice.

Dependency

Depends on MystenLabs/fastcrypto-lattice#1 (merged) - pinned via git rev 20a0d5c. That PR adds the deterministic encryption helpers and makes Ciphertext fields public.

Benchmarks

cargo test --release -p crypto --lib bench_ibe -- --ignored --nocapture (Apple Silicon, single-threaded; 20-iter avg for BF ops, 50 for BF extract, 5 for Falcon).

Boneh-Franklin BLS12-381

n t extract encrypt decrypt (no verify) decrypt (verify) pub key user sk enc. object
3 2 149 µs 1.98 ms 1.85 ms 4.19 ms 96 B 48 B 423 B
5 3 128 µs 2.87 ms 3.00 ms 6.93 ms 96 B 48 B 553 B
7 4 126 µs 3.92 ms 4.13 ms 9.99 ms 96 B 48 B 683 B
10 7 134 µs 5.64 ms 6.02 ms 14.78 ms 96 B 48 B 878 B

Falcon-512

n t keygen (total) extract encrypt decrypt (no verify) decrypt (verify) pub key user sk enc. object
3 2 6.28 s 9.4 ms 272 µs 79 µs 348 µs 2050 B 2091 B 12.6 KB
5 3 8.87 s 18.0 ms 457 µs 162 µs 680 µs 2050 B 2091 B 21.0 KB
7 4 12.01 s 14.8 ms 633 µs 185 µs 945 µs 2050 B 2091 B 29.3 KB
10 7 17.28 s 10.8 ms 937 µs 267 µs 1.45 ms 2050 B 2091 B 41.8 KB

Observations

  • Falcon ciphertexts are ~30-50x larger than BF (~4 KB/share vs ~65 B/share) - the dominant trade-off of the post-quantum scheme.
  • Falcon keys are ~20-40x larger than BF (2 KB vs 48-96 B).
  • Falcon encrypt/decrypt are actually faster than BF (lattice NTT + rounding vs BLS pairings); verification adds ~3-6x (BF) / ~5x (Falcon) to decrypt.
  • Falcon keygen (~1.5-2.3 s/keypair) and extract (~10-18 ms, variable due to rejection sampling) are the expensive operations - both one-time / per-request server-side costs.

Test plan

  • cargo test --workspace - all suites pass (26 crypto tests incl. new test_pq_round_trip_with_verification).
  • New test exercises the Falcon verification path: honest decrypt succeeds; flipping one bit of an encrypted share is rejected.
  • bench_ibe is #[ignore]d (excluded from the default test run).

Note

Marked [do not merge] - staging branch for the lattice IBE work.

@vercel

vercel Bot commented Aug 25, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
seal-example Ready Ready Preview Comment Aug 25, 2025 8:13am

@jonas-lj jonas-lj changed the title Jonas/pqibe [do not merge] Lattice-based IBE Aug 25, 2025
jonas-lj added 10 commits May 18, 2026 19:35
Replace per-share RNG draws with deterministic derivation from a single
global seed `r` plus `(index, pk_i, full_id)`, store `c_r = r XOR k_r` in
`IBEEncryptions::Falcon512.encrypted_randomness`. Implement
`decrypt_all_shares` for Falcon: recover `r`, re-derive each share's
randomness, recompute the share via `w XOR H(k)`, and verify the
recomputed ciphertext matches.
Run with:
  cargo test --release -p crypto --lib bench_ibe -- --ignored --nocapture

Times seal_encrypt and seal_decrypt (with and without verification) for
BF-BLS12381 and Falcon-512 at n in {3, 5, 7, 10}, plus Falcon keygen.
Marked #[ignore] so it doesn't run in the default test set.
Now that MystenLabs/fastcrypto-lattice#1 is merged, replace the local
path dep with a pinned git rev (20a0d5c).
After rebasing onto origin/main, the renamed/added IBEEncryptions methods
need Falcon arms, and the tests/bench need to use sui_sdk_types::Address
(NewObjectID) instead of sui_types::ObjectID when invoking seal_encrypt.

- Add Falcon512 arm to combine_and_verify_nonce (no-op: no nonce).
- Add Falcon512 arm to seal-cli's Display for IBEEncryptions.
- Convert ObjectID -> NewObjectID in Falcon tests and bench.
jonas-lj added 2 commits May 18, 2026 20:31
Adds per-config measurements: `extract` (deriving one user secret key),
public key size, user secret key size, and total encrypted object size.
fastcrypto-lattice renamed `falcon_util` to `falcon` (inner `falcon`
submodule -> `signature`) and dropped the `IBE` trait. Update imports
accordingly and re-pin to the new revision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant