Proto: add raw_hashes.mli to introduces new hashes in Michelson
This commit is contained in:
parent
70f4236d91
commit
5fe6bd9a54
@ -18,6 +18,7 @@
|
||||
v1/z.mli
|
||||
v1/lwt.mli
|
||||
v1/lwt_list.mli
|
||||
v1/raw_hashes.mli
|
||||
|
||||
;; Tezos extended stdlib
|
||||
v1/compare.mli
|
||||
|
14
src/lib_protocol_environment/sigs/v1/raw_hashes.mli
Normal file
14
src/lib_protocol_environment/sigs/v1/raw_hashes.mli
Normal file
@ -0,0 +1,14 @@
|
||||
(**************************************************************************)
|
||||
(* *)
|
||||
(* Copyright (c) 2014 - 2018. *)
|
||||
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
||||
(* *)
|
||||
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
||||
(* *)
|
||||
(**************************************************************************)
|
||||
|
||||
val blake2b : MBytes.t -> MBytes.t
|
||||
|
||||
val sha256 : MBytes.t -> MBytes.t
|
||||
|
||||
val sha512 : MBytes.t -> MBytes.t
|
@ -212,6 +212,11 @@ module Make (Context : CONTEXT) = struct
|
||||
module Format = Format
|
||||
module Option = Option
|
||||
module MBytes = MBytes
|
||||
module Raw_hashes = struct
|
||||
let sha256 msg = Hacl.Hash.SHA256.digest msg
|
||||
let sha512 msg = Hacl.Hash.SHA512.digest msg
|
||||
let blake2b msg = Blake2B.to_bytes (Blake2B.hash_bytes [ msg ])
|
||||
end
|
||||
module Z = struct
|
||||
include Z
|
||||
let to_bits ?(pad_to = 0) z =
|
||||
|
Loading…
Reference in New Issue
Block a user