$ docker run --rm --name validator-libsodium-usage-ruby-rbnacl-util-zero-bin2hex-2732 -t --mount type=bind,src=/tmp/validator-status-libsodium-usage-ruby-rbnacl-util-zero-bin2hex,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-util-zero-bin2hex -- bash -c 'PS4=$1; shift; set -x; source "$@"' validator-xtrace '__VALIDATOR_XTRACE__ ' /validator/tests/libsodium/tests/cases/usage/usage-ruby-rbnacl-util-zero-bin2hex.sh no override packages found; continuing with apt originals zeros = RbNaCl::Util.zeros(32) raise "unexpected zeros length: #{zeros.bytesize}" unless zeros.bytesize == 32 raise "zeros buffer not all NUL" unless zeros.bytes.all? { |b| b == 0 } raise "zeros hex mismatch" unless RbNaCl::Util.bin2hex(zeros) == "00" * 32 fixed = (0..15).to_a.pack("C*").force_encoding(Encoding::BINARY) hex = RbNaCl::Util.bin2hex(fixed) expected = "000102030405060708090a0b0c0d0e0f" raise "bin2hex KAT mismatch: #{hex}" unless hex == expected # 64-byte buffer should hex-encode to exactly 128 lowercase chars. buf = RbNaCl::Util.zeros(64) raise "long zeros hex length wrong" unless RbNaCl::Util.bin2hex(buf).length == 128 puts hex ' 000102030405060708090a0b0c0d0e0f