Skip to content

Commit

Permalink
Update udigest
Browse files Browse the repository at this point in the history
  • Loading branch information
survived committed Nov 22, 2023
1 parent 158ae9b commit 4a7f7e7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion generic-ec-zkp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
generic-ec = { path = "../generic-ec", default-features = false }
udigest = { git = "https://github.com/dfns-labs/udigest", branch = "version-0", features = ["derive"], optional = true }
udigest = { git = "https://github.com/dfns-labs/udigest", branch = "m", features = ["derive"], optional = true }

subtle = "2.4"
rand_core = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion generic-ec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories = []
[dependencies]
generic-ec-core = { path = "../generic-ec-core" }
generic-ec-curves = { path = "../generic-ec-curves", optional = true }
udigest = { git = "https://github.com/dfns-labs/udigest", branch = "version-0", features = ["derive"], optional = true }
udigest = { git = "https://github.com/dfns-labs/udigest", branch = "m", features = ["derive"], optional = true }

subtle = { version = "2.4", default-features = false }
rand_core = { version = "0.6", default-features = false }
Expand Down
6 changes: 2 additions & 4 deletions generic-ec/src/point/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ impl<E: Curve> udigest::Digestable for Point<E> {
B: udigest::Buffer,
{
let mut s = encoder.encode_struct();
s.add_field("curve").encode_leaf().chain(E::CURVE_NAME);
s.add_field("point")
.encode_leaf()
.chain(self.to_bytes(true));
s.add_field("curve").encode_leaf_value(E::CURVE_NAME);
s.add_field("point").encode_leaf_value(self.to_bytes(true));
s.finish();
}
}
6 changes: 2 additions & 4 deletions generic-ec/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,8 @@ impl<E: Curve> udigest::Digestable for Scalar<E> {
B: udigest::Buffer,
{
let mut s = encoder.encode_struct();
s.add_field("curve").encode_leaf().chain(E::CURVE_NAME);
s.add_field("scalar")
.encode_leaf()
.chain(self.to_be_bytes());
s.add_field("curve").encode_leaf_value(E::CURVE_NAME);
s.add_field("scalar").encode_leaf_value(self.to_be_bytes());
s.finish();
}
}

0 comments on commit 4a7f7e7

Please sign in to comment.