Skip to content

Commit

Permalink
Merge pull request #37 from fjarri/bump-deps
Browse files Browse the repository at this point in the history
Bump k256 to 0.7 and update its dependencies
  • Loading branch information
fjarri authored Mar 3, 2021
2 parents a168e32 + 3dbb9a4 commit 957bdee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions umbral-pre/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
categories = ["cryptography", "no-std"]

[dependencies]
k256 = { version = "0.6", default-features = false, features = ["ecdsa", "arithmetic"] }
k256 = { version = "0.7", default-features = false, features = ["ecdsa", "arithmetic"] }
blake2 = "0.9"
sha3 = "0.9"
sha2 = "0.9"
Expand All @@ -19,16 +19,16 @@ hkdf = "0.10"

# These packages are among the dependencies of the packages above.
# Their versions should be updated when the main packages above are updated.
elliptic-curve = { version = "0.7", default-features = false, features = ["digest"] }
elliptic-curve = { version = "0.8", default-features = false, features = ["digest"] }
digest = "0.9"
generic-array = "0.14"
aead = { version = "0.3", features = ["heapless"] }
ecdsa = "0.9"
ecdsa = "0.10"
signature = "1.2"
rand_core = { version = "0.5", default-features = false, features = ["getrandom"] }
typenum = "1.12"
getrandom = { version = "0.1", default-features = false, features = ["wasm-bindgen"] }
subtle = { version = "2.3", default-features = false }
subtle = { version = "2.4", default-features = false }

[dev-dependencies]
criterion = "0.3"
Expand Down
7 changes: 4 additions & 3 deletions umbral-pre/src/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl SecretKey {
// But we use this secret scalar to multiply not only points, but other scalars too.
// So there's no point in hiding the actual value here as long as
// it is going to be effectively dereferenced in other places.
CurveScalar(*self.0.secret_scalar())
CurveScalar(**self.0.secret_scalar())
}

/// Signs a message using the default RNG.
Expand Down Expand Up @@ -259,8 +259,9 @@ impl SerializableToArray for PublicKey {
}

fn from_array(arr: &GenericArray<u8, Self::Size>) -> Option<Self> {
CurvePoint::from_array(&arr)
.map(|cp| Self(BackendPublicKey::<CurveType>::from_affine(cp.0.to_affine())))
let cp = CurvePoint::from_array(&arr)?;
let backend_pk = BackendPublicKey::<CurveType>::from_affine(cp.0.to_affine()).ok()?;
Some(Self(backend_pk))
}
}

Expand Down

0 comments on commit 957bdee

Please sign in to comment.