Refactor primitives.

This commit is contained in:
Gav
2018-02-07 11:03:43 +01:00
parent 959b129f8d
commit 1b7f34bef2
39 changed files with 99 additions and 108 deletions
+4 -1
View File
@@ -22,9 +22,12 @@ extern crate untrusted;
extern crate rustc_hex;
use ring::{rand, signature};
use primitives::Signature;
use primitives::hash::H512;
use rustc_hex::FromHex;
/// Alias to 520-bit hash when used in the context of a signature on the relay chain.
pub type Signature = H512;
/// Verify a message without type checking the parameters' types for the right size.
pub fn verify(sig: &[u8], message: &[u8], public: &[u8]) -> bool {
let public_key = untrusted::Input::from(public);