From a3cfcc091acb70d52726ac3bb32441259249e93d Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Mon, 2 Jul 2018 10:42:53 +0200 Subject: [PATCH] Hacl: expose hashing constants --- vendors/ocaml-hacl/src/hacl.ml | 4 ++++ vendors/ocaml-hacl/src/hacl.mli | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/vendors/ocaml-hacl/src/hacl.ml b/vendors/ocaml-hacl/src/hacl.ml index 849eb849d..22a7a557d 100644 --- a/vendors/ocaml-hacl/src/hacl.ml +++ b/vendors/ocaml-hacl/src/hacl.ml @@ -50,6 +50,10 @@ module Hash = struct mutable pos : int ; } + let bytes = S.bytes + let blockbytes = S.blockbytes + let statebytes = S.statebytes + let init () = let state = Bigstring.create S.statebytes in let buf = Bigstring.create S.blockbytes in diff --git a/vendors/ocaml-hacl/src/hacl.mli b/vendors/ocaml-hacl/src/hacl.mli index 151585d8e..ca9fba02b 100644 --- a/vendors/ocaml-hacl/src/hacl.mli +++ b/vendors/ocaml-hacl/src/hacl.mli @@ -31,6 +31,10 @@ module Hash : sig module SHA256 : sig type state + val bytes : int + val blockbytes : int + val statebytes : int + (** Incremental Interface *) val init : unit -> state @@ -54,6 +58,10 @@ module Hash : sig module SHA512 : sig type state + val bytes : int + val blockbytes : int + val statebytes : int + (** Incremental Interface *) val init : unit -> state