1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Threshold decryption infrastructure for Newton Privacy Layer Phase 2.
//!
//! Implements t-of-n threshold HPKE decryption where operators hold key shares
//! produced by Feldman VSS. Each operator computes a partial DH output with a
//! DLEQ proof of correctness. The gateway combines valid partials via Lagrange
//! interpolation and feeds the result into the post-DH HPKE pipeline.
//!
//! # Modules
//!
//! - [`types`]: Core types — [`KeyShare`], [`PartialDecryption`], [`DleqProof`], etc.
//! - [`dealer`]: Trusted dealer Feldman VSS share generation (Phase 2A).
//! - [`dleq`]: DLEQ proof generation and verification.
//! - [`combine`]: Lagrange interpolation and full threshold decryption.
//!
//! # Example
//!
//! ```rust,ignore
//! use newton_core::dkg::{dealer, combine, types::ThresholdConfig};
//!
//! // Dealer generates 3-of-5 shares
//! let config = ThresholdConfig { threshold: 3, total: 5 };
//! let (tpk, commitment, shares) = dealer::generate_shares(config)?;
//!
//! // Client encrypts to tpk.hpke_public_key using standard HPKE
//! // ... (enc, ciphertext) = hpke::encrypt(tpk.hpke_public_key, plaintext, aad)
//!
//! // Each operator computes a partial decryption
//! let enc_edwards = combine::montgomery_to_edwards(&enc_bytes)?;
//! let partial = combine::compute_partial_decryption(
//! share.index, &share.secret_share, &enc_edwards,
//! );
//!
//! // Gateway combines and decrypts
//! let plaintext = combine::threshold_decrypt(
//! &partials, &enc, &tpk.hpke_public_key, &ciphertext, &aad,
//! &public_shares, config.threshold,
//! )?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;