Proto: add raw_hashes.mli to introduces new hashes in Michelson

This commit is contained in:
Benjamin Canou 2018-06-14 18:58:25 +02:00
parent 70f4236d91
commit 5fe6bd9a54
3 changed files with 20 additions and 0 deletions

View File

@ -18,6 +18,7 @@
v1/z.mli
v1/lwt.mli
v1/lwt_list.mli
v1/raw_hashes.mli
;; Tezos extended stdlib
v1/compare.mli

View 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

View File

@ -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 =