9 releases

Uses new Rust 2021

0.1.0 Feb 7, 2022
0.1.0-pre.1 Nov 25, 2021
0.0.10 Jul 9, 2021
0.0.6 Mar 9, 2021
0.0.2 Nov 10, 2020

#533 in Cryptography

Download history 511/week @ 2022-08-12 54/week @ 2022-08-19 47/week @ 2022-08-26 49/week @ 2022-09-02 234/week @ 2022-09-09 193/week @ 2022-09-16 41/week @ 2022-09-23 121/week @ 2022-09-30 562/week @ 2022-10-07 1331/week @ 2022-10-14 2721/week @ 2022-10-21 1008/week @ 2022-10-28 699/week @ 2022-11-04 1359/week @ 2022-11-11 2142/week @ 2022-11-18 1827/week @ 2022-11-25

6,360 downloads per month
Used in 4 crates (2 directly)

MPL-2.0 license

1.5MB
1K SLoC

HPKE

Maturity Level Build & Test ARM Build crates.io Docs Rust Version

An implementation of HPKE 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.

This version is compatible with draft-12, which is expected to be equivalent to the RFC.

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 used itself. Instead it expects an implementation of the HpkeCrypto trait.

Dependencies