Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9b8a283
introduced "with_crypto" feature and applied switches like in substra…
Sep 30, 2019
9edc07e
introduced "with_crypto" feature and applied switches like in substra…
Sep 30, 2019
7097676
distinguishing core::hash vs std::hash
Sep 30, 2019
48e6e34
Merge branch 'master' into brenzi-no-std-crypto
brenzi Oct 10, 2019
5ab8bb2
@bkchr's review requests fulfilled
Oct 30, 2019
a4e2619
Merge branch 'master' into brenzi-no-std-crypto
brenzi Oct 30, 2019
ae0c870
fixes
Oct 30, 2019
cc60d56
revert dependency upgrade ed25519-dalek
Oct 30, 2019
233b026
added full_crypto features to all crates using app_crypto! macro
Oct 30, 2019
53ec53a
fixing CI complaints.
Oct 30, 2019
f6c5040
fix again
Oct 30, 2019
aa96e0f
adding CI test for with_crypto feature
Oct 30, 2019
f83bfe3
added full_crypto for ecdsa. now builds wit h--no-deafault-features -…
Oct 30, 2019
c6ee791
remove --release from CI test
Oct 30, 2019
536d6c3
@bkchr requested changes. moved full_crypto CI test to build stage
Oct 30, 2019
291baeb
fixing no_std issue
Oct 30, 2019
bcc7e32
CI fresh copy from srml-staking
Oct 30, 2019
a13cf9a
gitlab CI with +nightly
Oct 30, 2019
7f25925
solved no-feature-in-macro dilemma
Oct 31, 2019
104e5ca
cosmetics
Oct 31, 2019
b579288
Update core/application-crypto/src/sr25519.rs
brenzi Oct 31, 2019
f38ec5f
Update core/application-crypto/src/ed25519.rs
brenzi Oct 31, 2019
272a8af
even more simple
Oct 31, 2019
42d0270
undo line delete
Oct 31, 2019
1c721f2
refactoring app_crypto macro. splitting functionalities based on full…
Nov 3, 2019
99ef109
Merge branch 'master' into brenzi-no-std-crypto
brenzi Nov 3, 2019
d36abf5
whitespace cosmetics
Nov 4, 2019
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
Prev Previous commit
Next Next commit
distinguishing core::hash vs std::hash
  • Loading branch information
Alain Brenzikofer committed Sep 30, 2019
commit 7097676d22fa585192164ba56a24fc14c97f2e81
19 changes: 17 additions & 2 deletions core/primitives/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ impl<'de> Deserialize<'de> for Public {
}
}

#[cfg(feature = "with_crypto")]
#[cfg(all(feature = "with_crypto", feature = "std"))]
impl std::hash::Hash for Public {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.0.hash(state);
}
}

#[cfg(all(feature = "with_crypto", not(feature = "std")))]
impl core::hash::Hash for Public {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.0.hash(state);
Expand Down Expand Up @@ -237,13 +244,21 @@ impl std::fmt::Debug for Signature {
}
}

#[cfg(feature = "with_crypto")]
#[cfg(all(feature = "with_crypto", feature = "std"))]
impl std::hash::Hash for Signature {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
std::hash::Hash::hash(&self.0[..], state);
}
}

#[cfg(all(feature = "with_crypto", not(feature = "std")))]
impl core::hash::Hash for Signature {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
core::hash::Hash::hash(&self.0[..], state);
}
}


impl Signature {
/// A new instance from the given 64-byte `data`.
///
Expand Down
10 changes: 8 additions & 2 deletions core/primitives/src/sr25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,19 @@ impl<'de> Deserialize<'de> for Public {
}
}

#[cfg(feature = "with_crypto")]
#[cfg(all(feature = "with_crypto", feature = "std"))]
impl std::hash::Hash for Public {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.0.hash(state);
}
}

#[cfg(all(feature = "with_crypto", not(feature = "std")))]
impl core::hash::Hash for Public {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.0.hash(state);
}
}

/// An Schnorrkel/Ristretto x25519 ("sr25519") signature.
///
/// Instead of importing it for the local module, alias it to be available as a public type
Expand Down