Skip to content

Commit

Permalink
fix stupid bug & ark-serialize derive
Browse files Browse the repository at this point in the history
  • Loading branch information
mrain committed Sep 13, 2024
1 parent de12a32 commit ffc603b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ark-bw6-761 = { version = "0.4.0", default-features = false }
ark-ec = { version = "0.4.0", default-features = false }
ark-ff = { version = "0.4.0", default-features = false, features = [ "asm" ] }
ark-poly = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", default-features = false }
ark-serialize = { version = "0.4.0", default-features = false, features = [ "derive" ] }
ark-std = { version = "0.4.0", default-features = false }
derivative = { version = "2", features = ["use_core"] }
digest = { version = "0.10.1", default-features = false, features = [ "alloc" ] }
Expand Down
1 change: 1 addition & 0 deletions vdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ark-pallas = { version = "0.4.0", optional = true }
ark-serialize = { workspace = true }
ark-std = { workspace = true }
displaydoc = { workspace = true }
serde = { workspace = true }
sha3 = { workspace = true }

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion vdf/src/hashchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::{VDFError, VDF};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::vec::Vec;
use core::marker::PhantomData;
use serde::{Deserialize, Serialize};
use sha3::Digest;

/// Glorified bool type
Expand All @@ -25,6 +26,8 @@ type VerificationResult = Result<(), ()>;
PartialOrd,
CanonicalSerialize,
CanonicalDeserialize,
Serialize,
Deserialize,
)]
/// Public parameter for MinRoot DF,
pub struct HashChainParam {
Expand Down Expand Up @@ -55,7 +58,7 @@ impl VDF for HashChain {
) -> Result<(Self::Output, Self::Proof), VDFError> {
let mut output = *input;
for _ in 0..pp.difficulty {
output = sha3::Keccak256::digest(&input).into();
output = sha3::Keccak256::digest(&output).into();
}
Ok((output, output))
}
Expand Down

0 comments on commit ffc603b

Please sign in to comment.