SIGMA-I Key Exchange (#378)

* Move `KeGroup` to `KeyExchange::Group`

- Introduce `KeyExchange::Hash`, which separates the OPRF hash from the one used in `KeyExchange`.
- Remove `De/Serialize` requirement on key exchange messages and states, which forced a lot of where bounds on downstream users.
- Rename `KeGroup` to `Group`.
- Replace `D` generic for hash with `H`.

* Use `voprf::derive_key()` directly

* Implement SIGMA-I key exchange

* Improve `KeyExchange` for SIGMA-I and Ed25519

* Implement EdDSA

* Un-qualify some method calls

* SIGMA-I: only include client identity in client mac

* SIGMA-I: include server mac in client signature

* Expose key exchange types in `crate` & move modules

* Implement Ed25519ph

* Document `ed25519` crate feature

* Remove `ristretto255-voprf` crate feature

* Adjust CI crate feature testing

* Fix Rustdoc

* Remove unnecessary generic parameters from SIGMA-I

* Properly mark to-do's with TODO

* Assorted fixes

* SIGMA-I: include context in signature

* SIGMA-I: include identifiers in signature

* Merge `ServerLoginStart/FinishParameters`

* Re-export more necessary types

* More carefully expose types

* Add ECDSA test

* SIGMA-I: share context hashing

* De-duplicate client static public key storage

* Hide `KeyExchange` better

* Use the correct hash in the root documentation

* Bump `derive-where`

* Format documentation examples a bit further

* Add remote OPRF seed documentation

* Rename `deserialize_key_pair` to `deserialize_take_key_pair`

* Add more key tests

* Remove `SharedSecret` trait

* SIGMA-I refactor message API

* Share more implementation between 3DH and SIGMA-I

* Remove unnecessary zero scalar check for Curve25519

* Use correct hash in test

* Add some more TODOs

* Exclude `tests` folder from Cargo publishing

* Enable missing dependencies

* Use right crate for testing Ed25519

* Remove unnecessary `Sized` constraints

* Remove unnecessary `ecdsa` crate features

* Move signature de/serialization to trait methods

* Nit: move import to appropriate location

* Add warning to SIGMA-I
This commit is contained in:
daxpedda
2025-05-19 13:56:25 -07:00
committed by GitHub
parent 58b4d746c0
commit bebd2c605b
37 changed files with 9402 additions and 3375 deletions
+16 -12
View File
@@ -13,10 +13,12 @@ jobs:
fail-fast: false
matrix:
backend_feature:
- --features ristretto255-voprf
-
- --features curve25519,ristretto255-voprf
- --features ristretto255
- --features curve25519
- --features ecdsa
- --features ed25519
- --features ristretto255,curve25519,ecdsa,ed25519
frontend_feature:
-
- --features argon2
@@ -69,10 +71,12 @@ jobs:
# 32-bit x86
- i686-unknown-linux-gnu
backend_feature:
- --features ristretto255-voprf
-
- curve25519,ristretto255-voprf
- curve25519
- --features ristretto255
- --features curve25519
- --features ecdsa
- --features ed25519
- --features ristretto255,curve25519,ecdsa,ed25519
steps:
- uses: actions/checkout@main
- uses: hecrj/setup-rust-action@v2
@@ -140,10 +144,12 @@ jobs:
# for any no_std target
- thumbv6m-none-eabi
backend_feature:
- ristretto255-voprf
-
- curve25519,ristretto255-voprf
- ristretto255
- curve25519
- ecdsa
- ed25519
- ristretto255,curve25519,ecdsa,ed25519
frontend_feature:
- argon2
- serde
@@ -160,10 +166,8 @@ jobs:
fail-fast: false
matrix:
backend_feature:
- --features ristretto255-voprf
- --features ristretto255
-
- --features curve25519,ristretto255-voprf
- --features curve25519
steps:
- name: Checkout sources
uses: actions/checkout@main
@@ -200,7 +204,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --features argon2,std,curve25519 -- -D warnings
args: --all-targets --features argon2,std,curve25519,ecdsa,ed25519 -- -D warnings
- name: Run cargo doc
uses: actions-rs/cargo@v1
@@ -208,7 +212,7 @@ jobs:
RUSTDOCFLAGS: -D warnings
with:
command: doc
args: --no-deps --document-private-items --features argon2,std,curve25519
args: --no-deps --document-private-items --features argon2,std,curve25519,ecdsa,ed25519
format:
name: cargo fmt