Expand description
Threshold ECIES over P-256 — real implementation.
ECIES (Elliptic Curve Integrated Encryption Scheme) on P-256:
- Encryptor generates ephemeral scalar
r, computesR = r * G - Encryptor computes ECDH shared secret
K = r * recipient_pubkey - Encryptor derives AEAD key from
Kvia HKDF-SHA256 - Encryptor encrypts plaintext with AES-256-GCM
- Output:
(R, ciphertext, nonce, tag)
Threshold variant: recipient’s private scalar x is Shamir-shared
among N parties. Each party computes partial_i = x_i * R. Combined
via Lagrange: sum_i λ_i * partial_i = x * R = K. From K, the AEAD
key is derived and decryption proceeds normally.
Used for browser-side key escrow and Mode 2 enterprise secrets.
See TODO.roadmap/31-threshold-encryption.md for full spec.
Re-exports§
pub use keys::generate_keypair;pub use shamir::recover_secret;pub use shamir::split_secret;
Modules§
- keys
- Keypair generation for threshold ECIES-P256.
- shamir
- Real Shamir secret sharing over the P-256 scalar field.
Structs§
- Decryption
Share - Share of the threshold ECIES secret key.
- Encrypted
Blob - ECIES-encrypted blob.
- Partial
Decryption - Partial decryption from one party:
share * Ras SEC1 bytes. - Public
Key - Threshold ECIES public key.
Enums§
- Ecies
Error - Errors during threshold ECIES operations.
Constants§
- ALGORITHM
- Algorithm identifier.
Functions§
- aggregate_
partials - Aggregate T partial decryptions to recover the plaintext.
- encrypt
- Encrypt
plaintexttorecipientusing ECIES-P256 + AES-256-GCM. - partial_
decrypt - Compute a partial decryption:
share * Rwhere R is the blob’s ephemeral public key.