Skip to content

Commit

Permalink
Update zeroize (#113)
Browse files Browse the repository at this point in the history
* Update zeroize

* Fix clippy warnings
  • Loading branch information
Denis Varlakov authored Apr 23, 2021
1 parent 44610b1 commit 7b70e98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "curv"
version = "0.6.1"
version = "0.6.2"
edition = "2018"
authors = ["Omer Shlomovits"]
license = "MIT"
Expand Down Expand Up @@ -33,7 +33,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
sha2 = "0.8.0"
sha3 = "0.8.2"
zeroize = "0.10"
zeroize = "1"

rust-gmp-kzen = { version = "0.5", features = ["serde_support"], optional = true }
num-bigint = { version = "0.3", features = ["serde"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion src/elliptic/curves/bls12_381/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl ECPoint for G1Point {
fn bytes_compressed_to_big_int(&self) -> BigInt {
let tmp = G1Compressed::from_affine(self.ge);
let bytes = tmp.as_ref();
BigInt::from_bytes(&bytes[..])
BigInt::from_bytes(bytes)
}

fn from_bytes(bytes: &[u8]) -> Result<G1Point, ErrorKey> {
Expand Down
8 changes: 3 additions & 5 deletions src/elliptic/curves/bls12_381/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl ECPoint for G2Point {
fn bytes_compressed_to_big_int(&self) -> BigInt {
let tmp = G2Compressed::from_affine(self.ge);
let bytes = tmp.as_ref();
BigInt::from_bytes(&bytes[..])
BigInt::from_bytes(bytes)
}

fn from_bytes(bytes: &[u8]) -> Result<G2Point, ErrorKey> {
Expand Down Expand Up @@ -520,8 +520,7 @@ impl<'de> Visitor<'de> for Bls12381G2PointVisitor {
.ok_or_else(|| V::Error::invalid_length(0, &"a single element"))?;
let bytes_bn = BigInt::from_hex(bytes_str).map_err(V::Error::custom)?;
let bytes = BigInt::to_bytes(&bytes_bn);
Ok(G2Point::from_bytes(&bytes[..])
.map_err(|_| V::Error::custom("failed to parse g2 point"))?)
G2Point::from_bytes(&bytes[..]).map_err(|_| V::Error::custom("failed to parse g2 point"))
}

fn visit_map<E: MapAccess<'de>>(self, mut map: E) -> Result<G2Point, E::Error> {
Expand All @@ -539,8 +538,7 @@ impl<'de> Visitor<'de> for Bls12381G2PointVisitor {
let bytes_bn = BigInt::from_hex(&bytes_str).map_err(E::Error::custom)?;
let bytes = BigInt::to_bytes(&bytes_bn);

Ok(G2Point::from_bytes(&bytes[..])
.map_err(|_| E::Error::custom("failed to parse g2 point"))?)
G2Point::from_bytes(&bytes[..]).map_err(|_| E::Error::custom("failed to parse g2 point"))
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
License MIT: <https://github.com/KZen-networks/curv/blob/master/LICENSE>
*/

#![allow(clippy::upper_case_acronyms)]

pub mod elliptic;

pub mod arithmetic;
Expand Down

0 comments on commit 7b70e98

Please sign in to comment.