crypto/blake
lib/crypto/blake.vklib/crypto/blake.vk Pure-Veko RFC 7693 BLAKE2b cryptographic hash and keyed MAC (1..64 byte digest). Zero capabilities required.
blake2b-keyed = fn [msg bytes, key bytes, out_len i64] bytes
Computes an RFC 7693 BLAKE2b digest of out_len (1..64) bytes with optional key (0..64 bytes).
Executable Example
use [b2 = crypto/blake, hex = codec/hex]
h = hex/encode (b2/blake2b-512 (bytes/from-str 'abc'))
if h != 'ba80a53f981c4d0d6a2797b69f12f6e94c212f14685ac4b74b12bb6fdbffa2d17d87c5392aab792dc252d5de4533cc9518d38aa8dbf1925ab92386edd4009923' [
err 'blake2b-512 vector mismatch'
] else [ .ok ]
blake2b = fn [msg bytes, out_len i64] bytes
Computes an unkeyed BLAKE2b digest of out_len (1..64) bytes.