6 | import public Crypto.Hash.Interfaces
7 | import public Crypto.Hash.SHA2
8 | import public Crypto.Hash.SHA1
9 | import public Crypto.Hash.MD5
13 | init : (0 algo : Type) -> Hash algo => algo
14 | init algo = initialize
18 | hash : (0 algo : Type) -> Hash algo => (message : List Bits8) -> Vect (digest_nbyte {algo}) Bits8
19 | hash algo xs = finalize $
update xs $
Hash.init algo
23 | init_mac : (0 algo : Type) -> MAC key algo => key -> algo
24 | init_mac algo key = initialize_mac key
28 | mac : (0 algo : Type) -> MAC key algo => key -> (message : List Bits8) -> Vect (digest_nbyte {algo}) Bits8
29 | mac algo key xs = finalize $
update xs $
Hash.init_mac algo key