Skip to content

Commit

Permalink
Upgrade p256 to v0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jan 19, 2023
1 parent 8901b74 commit 26f1fa8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- --features serde
toolchain:
- stable
- 1.57.0
- 1.60.0
name: test
steps:
- name: Checkout sources
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
matrix:
toolchain:
- stable
- 1.57.0
- 1.60.0
name: test simple_login command-line example
steps:
- name: install expect
Expand All @@ -101,7 +101,7 @@ jobs:
matrix:
toolchain:
- stable
- 1.57.0
- 1.60.0
name: test digital_locker command-line example
steps:
- name: install expect
Expand Down
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "Apache-2.0 OR MIT"
name = "opaque-ke"
readme = "README.md"
repository = "https://github.com/novifinancial/opaque-ke"
rust-version = "1.57"
rust-version = "1.60"
version = "2.0.0"

[features]
Expand Down Expand Up @@ -52,14 +52,15 @@ chacha20poly1305 = "0.10"
criterion = "0.4"
hex = "0.4"
json = "0.12"
p256 = { version = "0.11", default-features = false, features = [
p256 = { version = "0.12", default-features = false, features = [
"hash2curve",
"voprf",
] }
proptest = "1"
rand = "0.8"
regex = "1"
rustyline = "10"
# MSRV
rustyline = "10.1.1"
scrypt = "0.10"
serde_json = "1"

Expand All @@ -75,3 +76,6 @@ targets = []
[[example]]
name = "simple_login"
required-features = ["argon2"]

[patch.crates-io]
voprf = { git = "https://github.com/facebook/voprf" }
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ opaque-ke = "2"

### Minimum Supported Rust Version

Rust **1.57** or higher.
Rust **1.60** or higher.

Audit
-----
Expand Down
5 changes: 3 additions & 2 deletions src/key_exchange/group/elliptic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ where
G: GroupDigest,
FieldSize<Self>: ModulusSize,
AffinePoint<Self>: FromEncodedPoint<Self> + ToEncodedPoint<Self>,
ProjectivePoint<Self>: CofactorGroup + ToEncodedPoint<Self>,
ProjectivePoint<Self>: CofactorGroup,
Scalar<Self>: FromOkm,
{
type Pk = ProjectivePoint<Self>;
Expand All @@ -37,7 +37,8 @@ where
type SkLen = FieldSize<Self>;

fn serialize_pk(pk: Self::Pk) -> GenericArray<u8, Self::PkLen> {
GenericArray::clone_from_slice(pk.to_encoded_point(true).as_bytes())
let affine: AffinePoint<Self> = pk.into();
GenericArray::clone_from_slice(affine.to_encoded_point(true).as_bytes())
}

fn deserialize_pk(bytes: &[u8]) -> Result<Self::Pk, InternalError> {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//!
//! ### Minimum Supported Rust Version
//!
//! Rust **1.57** or higher.
//! Rust **1.60** or higher.
//!
//! # Overview
//!
Expand Down

0 comments on commit 26f1fa8

Please sign in to comment.