18 releases

0.2.0 Dec 2, 2023
0.1.2 Nov 21, 2023
0.1.1 Jun 22, 2023
0.1.0 Feb 7, 2022
0.0.2 Nov 10, 2020

#1659 in Cryptography

Download history 3477/week @ 2024-10-02 3058/week @ 2024-10-09 5394/week @ 2024-10-16 4808/week @ 2024-10-23 4377/week @ 2024-10-30 4904/week @ 2024-11-06 4599/week @ 2024-11-13 5969/week @ 2024-11-20 5315/week @ 2024-11-27 4477/week @ 2024-12-04 7030/week @ 2024-12-11 4260/week @ 2024-12-18 2329/week @ 2024-12-25 3061/week @ 2025-01-01 3730/week @ 2025-01-08 5090/week @ 2025-01-15

14,503 downloads per month
Used in 12 crates (3 directly)

MPL-2.0 license

1.5MB
1.5K SLoC

HPKE

Build & Test crates.io Docs Rust Version

An implementation of HPKE (RFC 9180) with flexible crypto backends.

From the RFC:

This scheme provides a variant of public-key encryption of arbitrary-sized plaintexts for a recipient public key. It also includes three authenticated variants, including one which authenticates possession of a pre-shared key, and two optional ones which authenticate possession of a KEM private key.

Supported HPKE modes

  • Base
  • PSK
  • Auth
  • AuthPSK

Supported cipher suites

KEM

  • DH KEM x25519
  • DH KEM P256

AEAD

  • AES GCM 128
  • AES GCM 256
  • ChaCha20 Poly1305
  • Exporter only

KDF

  • HKDF SHA-256
  • HKDF SHA-384
  • HKDF SHA-512

Crypto Backends

This crate does not implement the cryptographic primitives itself. Instead it expects an implementation of the HpkeCrypto trait.

Dependencies