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

#546 in Cryptography

Download history 1955/week @ 2023-12-20 1295/week @ 2023-12-27 3385/week @ 2024-01-03 2431/week @ 2024-01-10 3113/week @ 2024-01-17 2384/week @ 2024-01-24 2970/week @ 2024-01-31 2586/week @ 2024-02-07 2688/week @ 2024-02-14 3466/week @ 2024-02-21 2400/week @ 2024-02-28 1498/week @ 2024-03-06 2527/week @ 2024-03-13 2144/week @ 2024-03-20 2055/week @ 2024-03-27 2653/week @ 2024-04-03

9,625 downloads per month
Used in 4 crates (2 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