Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to strobe-rs for STROBE dep #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ exclude = [".travis.yml", ".gitignore"]
features = ["nightly"]

[dependencies]
keccak = { version = "0.1.0", default-features = false }
byteorder = { version = "1.2.4", default-features = false }
keccak = { version = "0.1", default-features = false }
byteorder = { version = "1.2", default-features = false }
zeroize = { version = "1", default-features = false, features = ["zeroize_derive"] }
rand_core = { version = "0.5", default-features = false }
hex = {version = "0.3", default-features = false, optional = true}
strobe-rs = "0.8"

[dev-dependencies]
strobe-rs = "0.5"
curve25519-dalek = "2"
rand_chacha = "0.2"

Expand Down
10 changes: 0 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@
//! Note that docs will only build on nightly Rust until
//! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732).

#[cfg(target_endian = "big")]
compile_error!(
r#"
This crate doesn't support big-endian targets, since I didn't
have one to test correctness on. If you're seeing this message,
please file an issue!
"#
);

mod constants;
mod strobe;
mod transcript;

pub use crate::transcript::Transcript;
Expand Down
233 changes: 0 additions & 233 deletions src/strobe.rs

This file was deleted.

11 changes: 5 additions & 6 deletions src/transcript.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use rand_core;
use strobe_rs::{SecParam, Strobe};
use zeroize::Zeroize;

use crate::strobe::Strobe128;

fn encode_u64(x: u64) -> [u8; 8] {
use byteorder::{ByteOrder, LittleEndian};

Expand Down Expand Up @@ -52,7 +51,7 @@ fn encode_usize_as_u32(x: usize) -> [u8; 4] {
/// Merlin](https://merlin.cool/use/index.html) section.
#[derive(Clone, Zeroize)]
pub struct Transcript {
strobe: Strobe128,
strobe: Strobe,
}

impl Transcript {
Expand Down Expand Up @@ -80,7 +79,7 @@ impl Transcript {
}

let mut transcript = Transcript {
strobe: Strobe128::new(MERLIN_PROTOCOL_LABEL),
strobe: Strobe::new(MERLIN_PROTOCOL_LABEL, SecParam::B128),
};
transcript.append_message(b"dom-sep", label);

Expand Down Expand Up @@ -279,7 +278,7 @@ impl Transcript {
/// [rekey_with_witness_bytes]: TranscriptRngBuilder::rekey_with_witness_bytes
/// [finalize]: TranscriptRngBuilder::finalize
pub struct TranscriptRngBuilder {
strobe: Strobe128,
strobe: Strobe,
}

impl TranscriptRngBuilder {
Expand Down Expand Up @@ -349,7 +348,7 @@ impl TranscriptRngBuilder {
/// Randomness](https://merlin.cool/transcript/rng.html) section of
/// the Merlin website.
pub struct TranscriptRng {
strobe: Strobe128,
strobe: Strobe,
}

impl rand_core::RngCore for TranscriptRng {
Expand Down