core_crypto/signature.rs
1// Copyright 2021 BlockPuppets developers.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9use super::SIGNATURE_LENGTH;
10
11construct_fixed_hash! {
12 /// 512 bit hash type.
13 pub struct Signature(SIGNATURE_LENGTH);
14}
15
16impl signature::Signature for Signature {
17 fn from_bytes(bytes: &[u8]) -> Result<Self, signature::Error> {
18 Ok(Self::from_slice(bytes.into()))
19 }
20}