package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-libs.mec/Mec/Digestif/BLAKE2B/index.html
Module Digestif.BLAKE2B
Source
include S
Size of hash results, in bytes.
feed_bytes msg t
adds informations in msg
to t
. feed
is analogous to appending: feed (feed t msg1) msg2 = feed t (append msg1 msg2)
Same as feed_bytes
but for String.t
.
Same as feed_bytes
but for bigstring
.
feedi_bytes t iter = let r = ref t in iter (fun msg -> r := feed !r msg); !r
digest_bytes msg
is the digest of msg
.
digest_bytes msg = get (feed_bytes empty msg)
.
Same as digest_bytes
but for a String.t
.
Same as digest_bytes
but for a bigstring
.
Specialization of digesti_bytes
with a list of Bytes.t
(see iter
).
Same as digestv_bytes
but for String.t
.
Same as digestv_bytes
but for bigstring
.
unsafe_compare
function returns 0
on equality and a negative/positive int
depending on the difference (like String.compare
). This is usually OK, but this is not constant time, so in some cases it could leak some information.
of_hex
tries to parse an hexadecimal representation of t
. of_hex
raises an invalid_argument
when input is malformed. We take only firsts digest_size
hexadecimal values and ignore rest of input. If it has not enough hexadecimal values, trailing values of the output hash are zero (\x00
),
of_hex
tries to parse an hexadecimal representation of t
. of_hex
returns None
when input is malformed. We take only first digest_size
hexadecimal values and ignore rest of input. If it has not enough hexadecimal values, trailing values of the output hash are zero (\x00
).
of_raw_string s
see s
as a hash. Useful when reading serialized hashes.
of_raw_string_opt s
see s
as a hash. Useful when reading serialized hashes. Returns None
if s
is not the digest_size
bytes long.