Skip to main content

Crate confium_tc_ecies_p256

Crate confium_tc_ecies_p256 

Source
Expand description

Threshold ECIES over P-256 — real implementation.

ECIES (Elliptic Curve Integrated Encryption Scheme) on P-256:

  • Encryptor generates ephemeral scalar r, computes R = r * G
  • Encryptor computes ECDH shared secret K = r * recipient_pubkey
  • Encryptor derives AEAD key from K via 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::Share;
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§

DecryptionShare
Share of the threshold ECIES secret key.
EncryptedBlob
ECIES-encrypted blob.
PartialDecryption
Partial decryption from one party: share * R as SEC1 bytes.
PublicKey
Threshold ECIES public key.

Enums§

EciesError
Errors during threshold ECIES operations.

Constants§

ALGORITHM
Algorithm identifier.

Functions§

aggregate_partials
Aggregate T partial decryptions to recover the plaintext.
encrypt
Encrypt plaintext to recipient using ECIES-P256 + AES-256-GCM.
partial_decrypt
Compute a partial decryption: share * R where R is the blob’s ephemeral public key.