General Improvements (#268)

* Move `elliptic-curve` implementation to points to allow `Zeroize`

* Simplify `Ristretto255::random_scalar` implementation

* Fix `Ristretto255` deserialization

* Remove unnecessary check in `Ristretto255::random_scalar`

* Base `X25519` implementation on `curve25519-dalek`

* Constrain public and secret key to `Copy`

* Replace manual `ZeroizeOnDrop` implementation with `derive`

* Update dependencies

* Add `warn(unused_crate_dependencies)`

* Sync crate feature naming with `voprf`

* Remove unnecessary dependency crate features

* Never produce a zero scalar

* Rename `OprfGroup` to `OprfCs`

* Rename `TripleDH` to `TripleDh`

* Remove `slow-hash` crate feature

* Rename `NoOpHash` to `Identity`

* Rename `SlowHash` to `Ksf`

* Move `KeyExchange` type definitions down

* Deserialize secret and public keys from slices

* Remove `PrivateKey::from_bytes`

* Rename `From/ToBytes` to `De/Serialize`

* Re-export `serde_` as `serde`

* Custom `De/Serialize` implementation for keys

* Remove custom `De/Serialize` implementation

* Run Taplo v0.6
This commit is contained in:
daxpedda
2022-04-01 16:10:00 -07:00
committed by GitHub
parent f952a26e29
commit 384207acbb
25 changed files with 849 additions and 1109 deletions
+33 -33
View File
@@ -13,16 +13,16 @@ jobs:
fail-fast: false
matrix:
backend_feature:
- --features ristretto255_u64,ristretto255_voprf
- --features ristretto255_u32,ristretto255_voprf
-
- --features x25519_u64,ristretto255_u64,ristretto255_voprf
- --features x25519_u32,ristretto255_u32,ristretto255_voprf
- --features x25519_u64
- --features x25519_u32
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
- --features x25519-u64
- --features x25519-u32
frontend_feature:
-
- --features slow-hash
-
- --features argon2
- --features serde
toolchain:
- stable
@@ -61,13 +61,13 @@ jobs:
# 32-bit x86
- i686-unknown-linux-gnu
backend_feature:
- --features ristretto255_u64,ristretto255_voprf
- --features ristretto255_u32,ristretto255_voprf
-
- x25519_u64,ristretto255_u64,ristretto255_voprf
- x25519_u32,ristretto255_u64,ristretto255_voprf
- x25519_u64
- x25519_u32
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- x25519-u64,ristretto255-u64,ristretto255-voprf
- x25519-u32,ristretto255-u64,ristretto255-voprf
- x25519-u64
- x25519-u32
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
@@ -135,15 +135,15 @@ jobs:
# for any no_std target
- thumbv6m-none-eabi
backend_feature:
- ristretto255_u64,ristretto255_voprf
- ristretto255_u32,ristretto255_voprf
-
- x25519_u64,ristretto255_u64,ristretto255_voprf
- x25519_u32,ristretto255_u32,ristretto255_voprf
- x25519_u64
- x25519_u32
- ristretto255-u64,ristretto255-voprf
- ristretto255-u32,ristretto255-voprf
-
- x25519-u64,ristretto255-u64,ristretto255-voprf
- x25519-u32,ristretto255-u32,ristretto255-voprf
- x25519-u64
- x25519-u32
frontend_feature:
- slow-hash
- argon2
- serde
steps:
- uses: actions/checkout@v2
@@ -158,13 +158,13 @@ jobs:
fail-fast: false
matrix:
backend_feature:
- --features ristretto255_u64,ristretto255_voprf
- --features ristretto255_u32,ristretto255_voprf
-
- --features x25519_u64,ristretto255_u64,ristretto255_voprf
- --features x25519_u32,ristretto255_u32,ristretto255_voprf
- --features x25519_u32
- --features x25519_u32
- --features ristretto255-u64,ristretto255-voprf
- --features ristretto255-u32,ristretto255-voprf
-
- --features x25519-u64,ristretto255-u64,ristretto255-voprf
- --features x25519-u32,ristretto255-u32,ristretto255-voprf
- --features x25519-u32
- --features x25519-u32
steps:
- name: Checkout sources
uses: actions/checkout@v2
@@ -201,7 +201,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --features slow-hash,std,x25519_u64 -- -D warnings
args: --all-targets --features argon2,std,x25519-u64 -- -D warnings
- name: Run cargo doc
uses: actions-rs/cargo@v1
@@ -209,7 +209,7 @@ jobs:
RUSTDOCFLAGS: -D warnings
with:
command: doc
args: --no-deps --document-private-items --features slow-hash,std,x25519_u64
args: --no-deps --document-private-items --features argon2,std,x25519-u64
format:
name: cargo fmt