Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
abe119ab
Commit
abe119ab
authored
4 years ago
by
Tomasz Drwięga
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add keccak-512 to host functions. (#7531)
parent
36a684a1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
substrate/primitives/core/src/hashing.rs
+5
-0
5 additions, 0 deletions
substrate/primitives/core/src/hashing.rs
substrate/primitives/io/src/lib.rs
+5
-0
5 additions, 0 deletions
substrate/primitives/io/src/lib.rs
with
10 additions
and
0 deletions
substrate/primitives/core/src/hashing.rs
+
5
−
0
View file @
abe119ab
...
...
@@ -16,6 +16,11 @@
// limitations under the License.
//! Hashing functions.
//!
//! This module is gated by `full-crypto` feature. If you intend to use any of the functions
//! defined here within your runtime, you should most likely rather use [sp_io::hashing] instead,
//! unless you know what you're doing. Using `sp_io` will be more performant, since instead of
//! computing the hash in WASM it delegates that computation to the host client.
use
blake2_rfc
;
use
sha2
::{
Digest
,
Sha256
};
...
...
This diff is collapsed.
Click to expand it.
substrate/primitives/io/src/lib.rs
+
5
−
0
View file @
abe119ab
...
...
@@ -735,6 +735,11 @@ pub trait Hashing {
sp_core
::
hashing
::
keccak_256
(
data
)
}
/// Conduct a 512-bit Keccak hash.
fn
keccak_512
(
data
:
&
[
u8
])
->
[
u8
;
64
]
{
sp_core
::
hashing
::
keccak_512
(
data
)
}
/// Conduct a 256-bit Sha2 hash.
fn
sha2_256
(
data
:
&
[
u8
])
->
[
u8
;
32
]
{
sp_core
::
hashing
::
sha2_256
(
data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment