Skip to content

Add SPAKE2+ password authenticated key exchange (RFC 9383)#5711

Open
randombit wants to merge 1 commit into
masterfrom
jack/spake2+
Open

Add SPAKE2+ password authenticated key exchange (RFC 9383)#5711
randombit wants to merge 1 commit into
masterfrom
jack/spake2+

Conversation

@randombit

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces SPAKE2+ (RFC 9383) as a new PAKE implementation in Botan 3, including native C++ APIs, FFI bindings, Python bindings, tests (KATs + round trips), and documentation/example material.

Changes:

  • Adds a new SPAKE2+ module with RFC 9383 ciphersuites and support for custom M/N generation via hash-to-curve.
  • Exposes SPAKE2+ via the C FFI and the Python botan3.py wrapper, including functional tests for both.
  • Adds RFC test vectors, new unit tests, and new API reference documentation (C++ + Python + FFI).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/pake/spake2p/spake2p.h New public C++ API for SPAKE2+ (system parameters, registration, prover/verifier contexts).
src/lib/pake/spake2p/spake2p.cpp New SPAKE2+ implementation (password derivation, key schedule, protocol flow).
src/lib/pake/spake2p/info.txt Registers the new SPAKE2+ module and its dependencies.
src/lib/ffi/ffi_spake2p.cpp Adds FFI implementation for SPAKE2+ APIs and context objects.
src/lib/ffi/ffi.h Bumps FFI API version and declares new SPAKE2+ FFI functions/types.
src/lib/ffi/ffi.cpp Extends botan_ffi_supports_api for the new FFI API version.
src/lib/ffi/info.txt Bumps the FFI module version define.
src/python/botan3.py Bumps required FFI version and adds Python SPAKE2+ wrapper APIs/classes.
src/scripts/test_python.py Adds a Python-level integration test for the new SPAKE2+ bindings.
src/tests/test_spake2p.cpp Adds SPAKE2+ KAT tests, round-trip tests, and password registration tests.
src/tests/data/pake/spake2p.vec Adds RFC 9383 Appendix C test vectors.
src/tests/test_ffi.cpp Adds SPAKE2+ FFI tests (happy path + tamper failure).
src/examples/spake2p.cpp Adds a C++ example program demonstrating SPAKE2+ usage.
doc/api_ref/spake2p.rst Adds C++ API reference documentation for SPAKE2+.
doc/api_ref/python.rst Documents SPAKE2+ Python API additions.
doc/api_ref/ffi.rst Updates the FFI version mapping table for the new API version.
doc/api_ref/contents.rst Adds spake2p to the API reference table of contents.
doc/roadmap.rst Removes SPAKE2+ from the roadmap since it is now implemented.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/pake/spake2p/spake2p.cpp
Comment thread src/lib/pake/spake2p/spake2p.cpp
@randombit
randombit force-pushed the jack/spake2+ branch 3 times, most recently from e58afeb to a493e35 Compare July 13, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants