Skip to content

Commit

Permalink
Upgrade p256 to v0.12 (facebook#90)
Browse files Browse the repository at this point in the history
* Upgrade `p256` to v0.12

* Upgrade MSRV to 1.60
  • Loading branch information
daxpedda authored Jan 19, 2023
1 parent 2a351ce commit daa8dc0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- --features serde
toolchain:
- stable
- 1.57.0
- 1.60.0
name: test
steps:
- name: Checkout sources
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
name = "voprf"
readme = "README.md"
repository = "https://github.com/novifinancial/voprf/"
rust-version = "1.57"
rust-version = "1.60"
version = "0.5.0-pre.1"

[features]
Expand Down Expand Up @@ -45,7 +45,7 @@ zeroize = { version = "1.5", default-features = false }
generic-array = { version = "0.14", features = ["more_lengths"] }
hex = "0.4"
json = "0.12"
p256 = { version = "0.11", default-features = false, features = [
p256 = { version = "0.12", default-features = false, features = [
"hash2curve",
"voprf",
] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ voprf = "0.5.0-pre.1"

### Minimum Supported Rust Version

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

Contributors
------------
Expand Down
5 changes: 3 additions & 2 deletions src/group/elliptic_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::{Error, InternalError, Result};
impl<C> Group for C
where
C: GroupDigest,
ProjectivePoint<Self>: CofactorGroup + ToEncodedPoint<Self>,
ProjectivePoint<Self>: CofactorGroup,
FieldSize<Self>: ModulusSize,
AffinePoint<Self>: FromEncodedPoint<Self> + ToEncodedPoint<Self>,
Scalar<Self>: FromOkm,
Expand Down Expand Up @@ -65,7 +65,8 @@ where
}

fn serialize_elem(elem: Self::Elem) -> GenericArray<u8, Self::ElemLen> {
let bytes = elem.to_encoded_point(true);
let affine: AffinePoint<Self> = elem.into();
let bytes = affine.to_encoded_point(true);
let bytes = bytes.as_bytes();
let mut result = GenericArray::default();
result[..bytes.len()].copy_from_slice(bytes);
Expand Down

0 comments on commit daa8dc0

Please sign in to comment.