$ docker run --rm --name validator-libsodium-usage-ruby-rbnacl-blake2b-keyed-length-2732 -t --mount type=bind,src=/tmp/validator-status-libsodium-usage-ruby-rbnacl-blake2b-keyed-length,dst=/validator/status validator-libsodium-shared bash -lc 'set -euo pipefail /validator/tests/_shared/install_override_debs.sh exec /validator/tests/_shared/run_library_tests.sh "$@"' validator-testcase libsodium usage-ruby-rbnacl-blake2b-keyed-length -- bash -c 'PS4=$1; shift; set -x; source "$@"' validator-xtrace '__VALIDATOR_XTRACE__ ' /validator/tests/libsodium/tests/cases/usage/usage-ruby-rbnacl-blake2b-keyed-length.sh no override packages found; continuing with apt originals key_a = ("\x02".b * 32) key_b = ("\x03".b * 32) message = "blake2b keyed message" digest_a = RbNaCl::Hash.blake2b(message, key: key_a, digest_size: 48) digest_b = RbNaCl::Hash.blake2b(message, key: key_b, digest_size: 48) raise "unexpected digest length: #{digest_a.bytesize}" unless digest_a.bytesize == 48 raise "different keys gave matching digests" if digest_a == digest_b again = RbNaCl::Hash.blake2b(message, key: key_a, digest_size: 48) raise "non-deterministic digest under same key" unless again == digest_a puts digest_a.unpack1("H*") ' 542a9f9f309573aa9140671d33fd8926099ce9b715d4ec26745069cd9e305a1f447def5767c5fd2670afc81116ac854b