Skip to content

Commit

Permalink
Src/Moving Hash type to crate::utils
Browse files Browse the repository at this point in the history
  • Loading branch information
rrtoledo committed Dec 24, 2024
1 parent a14c57d commit 0b2aacb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 27 deletions.
7 changes: 4 additions & 3 deletions src/centralized_telescope/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use super::proof::Proof;
use super::round::Round;
use super::setup::Setup;
use super::types::Hash;
use crate::utils::sample;
use crate::utils::types::Element;
use crate::utils::{
sample,
types::{Element, Hash},
};
use blake2::{Blake2s256, Digest};

/// Alba's proving algorithm, based on a depth-first search algorithm.
Expand Down
2 changes: 0 additions & 2 deletions src/centralized_telescope/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ mod round;

pub mod setup;

mod types;

mod wrapper;

// Re-exports
Expand Down
7 changes: 4 additions & 3 deletions src/centralized_telescope/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
#![doc = include_str!("../../docs/rustdoc/centralized_telescope/round.md")]

use super::types::Hash;
use crate::utils::sample;
use crate::utils::types::Element;
use crate::utils::{
sample,
types::{Element, Hash},
};
use blake2::{Blake2s256, Digest};

/// Round parameters
Expand Down
7 changes: 0 additions & 7 deletions src/centralized_telescope/types.rs

This file was deleted.

7 changes: 4 additions & 3 deletions src/simple_lottery/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
use super::proof::Proof;
use super::setup::Setup;
use super::types::Hash;
use crate::utils::sample;
use crate::utils::types::Element;
use crate::utils::{
sample,
types::{Element, Hash},
};
use blake2::{Blake2s256, Digest};

pub(super) fn prove(setup: &Setup, prover_set: &[Element]) -> Option<Proof> {
Expand Down
2 changes: 0 additions & 2 deletions src/simple_lottery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ pub mod setup;

pub mod proof;

mod types;

mod algorithm;

mod wrapper;
Expand Down
7 changes: 0 additions & 7 deletions src/simple_lottery/types.rs

This file was deleted.

7 changes: 7 additions & 0 deletions src/utils/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
pub(crate) const DATA_LENGTH: usize = 32;

/// Type of dataset's elements to lower bound
pub(crate) type Element = [u8; DATA_LENGTH];

/// Digest size for internal hashes
pub(crate) const DIGEST_SIZE: usize = 32;

/// Hash type for internal hashes
pub(crate) type Hash = [u8; DIGEST_SIZE];

0 comments on commit 0b2aacb

Please sign in to comment.