1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use crate::prelude::*;
use holo_hash::ActionHash;
use holo_hash::EntryHash;
use holo_hash::ExternalHash;
pub struct Hash256Bits([u8; 32]);
crate::secure_primitive!(Hash256Bits, 32);
pub struct Hash512Bits([u8; 64]);
crate::secure_primitive!(Hash512Bits, 64);
#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub enum HashInput {
    
    Entry(Entry),
    
    Action(Action),
    
    
    
    Blake2B(#[serde(with = "serde_bytes")] Vec<u8>, u8),
    
    Sha256(#[serde(with = "serde_bytes")] Vec<u8>),
    
    Sha512(#[serde(with = "serde_bytes")] Vec<u8>),
    
    
    
    Keccak256(#[serde(with = "serde_bytes")] Vec<u8>),
    
    Sha3256(#[serde(with = "serde_bytes")] Vec<u8>),
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub enum HashOutput {
    
    Entry(EntryHash),
    
    Action(ActionHash),
    
    External(ExternalHash),
    
    Blake2B(#[serde(with = "serde_bytes")] Vec<u8>),
    
    Sha256(Hash256Bits),
    
    Sha512(Hash512Bits),
    
    Keccak256(Hash256Bits),
    
    Sha3256(Hash256Bits),
}