Skip to content

Commit

Permalink
Merge branch 'no-std-multiencode' of https://github.com/iron-fish/iro…
Browse files Browse the repository at this point in the history
…nfish-frost into no-std-multiencode
  • Loading branch information
patnir committed Jul 23, 2024
2 parents 75890eb + d407838 commit 655c80c
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ed25519-dalek = { version = "2.1.0", features = ["rand_core"] }
rand_chacha = { version = "0.3.1", optional = true }
rand_core = "0.6.4"
reddsa = { git = "https://github.com/ZcashFoundation/reddsa.git", rev = "311baf8865f6e21527d1f20750d8f2cf5c9e531a", features = ["frost", "frost-rerandomized"] }
siphasher = { version = "1.0.0", optional = true }
siphasher = { version = "1.0.0", features =["serde_no_std"] }
x25519-dalek = { version = "2.0.0", features = ["reusable_secrets", "static_secrets"] }

[dev-dependencies]
Expand All @@ -27,5 +27,5 @@ rand = "0.8.5"
default = ["dkg"]

std = []
signing = ["dep:blake3", "dep:rand_chacha", "dep:siphasher", "std"]
signing = ["dep:blake3", "dep:rand_chacha", "std"]
dkg = []
10 changes: 0 additions & 10 deletions src/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,13 @@

use core::fmt;

#[cfg(feature = "std")]
use siphasher::sip::SipHasher24;
#[cfg(feature = "std")]
pub(crate) type ChecksumHasher = SipHasher24;

#[cfg(not(feature = "std"))]
use core::hash::SipHasher;
#[cfg(not(feature = "std"))]
pub(crate) type ChecksumHasher = SipHasher;


pub(crate) const CHECKSUM_LEN: usize = 8;

pub(crate) type Checksum = u64;



#[derive(Clone, Debug)]
pub enum ChecksumError {
SigningCommitmentError,
Expand Down
5 changes: 1 addition & 4 deletions src/dkg/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@

use crate::checksum::ChecksumError;
use crate::frost;
use crate::io;
use core::fmt;
use core::fmt::Debug;
use crate::io;


#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::string::String;



#[derive(Debug)]
pub enum Error {
InvalidInput(String),
Expand Down
3 changes: 1 addition & 2 deletions src/dkg/group_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use crate::io;
use crate::multienc;
use crate::participant::Identity;
use crate::participant::Secret;
use rand_core::CryptoRng;
use rand_core::RngCore;
use crate::io;

#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;


pub const GROUP_SECRET_KEY_LEN: usize = 32;

pub type GroupSecretKey = [u8; GROUP_SECRET_KEY_LEN];
Expand Down
1 change: 0 additions & 1 deletion src/dkg/round1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use crate::frost::Identifier;
use crate::frost::JubjubScalarField;
use crate::io;
use crate::multienc;
use crate::multienc::read_encrypted_blob;
use crate::participant;
use crate::participant::Identity;
use crate::serde::read_u16;
Expand Down
4 changes: 2 additions & 2 deletions src/multienc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ use x25519_dalek::ReusableSecret;
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
#[cfg(not(feature = "std"))]
use crate::alloc::borrow::ToOwned;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

pub const HEADER_SIZE: usize = 56;
pub const KEY_SIZE: usize = 32;
Expand Down
1 change: 0 additions & 1 deletion src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;


#[inline]
#[cfg(feature = "dkg")]
pub(crate) fn write_u16<W: io::Write>(mut writer: W, value: u16) -> io::Result<()> {
Expand Down

0 comments on commit 655c80c

Please sign in to comment.