pub fn encapsulate(
recipient_public_key: &PublicKey,
) -> Result<(Ciphertext, Vec<u8>), ElGamalError>Expand description
Encapsulate a fresh shared secret to recipient_public_key.
Standard ElGamal:
- Generate ephemeral scalar
r - c1 = r * G
- c2 = r * recipient_pubkey
- shared_secret = X-coordinate of c2 (32 bytes)
The receiver threshold-decrypts to recover the same c2 point, then takes its X-coordinate as the shared secret.