matrix-org / vodozemac

An implementation of Olm and Megolm in pure Rust.
Apache License 2.0
175 stars 31 forks source link

Add support for PQXDH #120

Open poljar opened 9 months ago

poljar commented 9 months ago

The PQXDH Key Agreement Protocol

This pull request implements the new post-quantum safe PQXDH Key Agreement Protocol.

The PQXDH Key Agreement Protocol is a hybrid protocol building on top of the the classical X3DH Key Agreement protocol. In addition to the three to four Diffie-Hellman steps in X3DH it includes a shared secret calculated using a post-quantum key encapsulation mechanism that has IND-CCA post-quantum security.

The pull request has picked Kyber as the key encapsulation mechanism, the exact Kyber implementation can be found here.

Missing pieces

Warning: This PR is in a early draft stage, while PQXDH is implemented and a higher level Session initialized using the PQXDH Key Agreement Protocol can be established, this PR does not use an AEAD to encrypt messages itself.

The use of an AEAD is required in the PQXDH specification.

Furthermore, encoding the new message types into and from a byte-stream is missing. Generating a Kyber fallback key is not supported as of now. Finally, pickling compatibility with libolm is currently broken.

Tasks