Hashing proc macro utils (#9875)

* hashing macro

* fmt

* use in easy place, and fix blake sizes

* fix

* Fixes, docs.
Allow ident as input.

* fix doc tests

* update error in test (nmapkey and key are same type).

* hashing crates under sp_core

* Doc updates and format.

* use all existing hashing functions.

* return array of u8

* Update primitives/core/hashing/proc-macro/src/impls.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* ToTokeen for an array of u8

* fix

* re

* Improve impls

* complete doc tests

* fmt

* fix doctest format

* fix ui test (nmap key type alias)

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
cheme
2021-11-02 10:35:23 +01:00
committed by GitHub
parent 098815948a
commit 471e9cfbf1
14 changed files with 547 additions and 143 deletions
+4
View File
@@ -66,6 +66,7 @@ sha2 = { version = "0.9.8", default-features = false, optional = true }
hex = { version = "0.4", default-features = false, optional = true }
twox-hash = { version = "1.6.1", default-features = false, optional = true }
libsecp256k1 = { version = "0.6", default-features = false, features = ["hmac", "static-context"], optional = true }
sp-core-hashing = { version = "4.0.0-dev", path = "./hashing", default-features = false, optional = true }
merlin = { version = "2.0", default-features = false, optional = true }
ss58-registry = "1.0.0"
sp-runtime-interface = { version = "4.0.0-dev", default-features = false, path = "../runtime-interface" }
@@ -76,6 +77,7 @@ hex-literal = "0.3.3"
rand = "0.7.2"
criterion = "0.3.3"
serde_json = "1.0"
sp-core-hashing-proc-macro = { version = "4.0.0-dev", path = "./hashing/proc-macro" }
[[bench]]
name = "bench"
@@ -118,6 +120,7 @@ std = [
"regex",
"num-traits/std",
"tiny-keccak",
"sp-core-hashing/std",
"sp-debug-derive/std",
"sp-externalities",
"sp-storage/std",
@@ -142,6 +145,7 @@ full_crypto = [
"sha2",
"twox-hash",
"libsecp256k1",
"sp-core-hashing",
"sp-runtime-interface/disable_target_static_assertions",
"merlin",
]