verity: support salt=random generation

Many CrOS build scripts generate a salt randomly (using things like xxd
on /dev/urandom).  Add support for that directly to verity so we don't
have to copy these ad-hoc implementations around.

TEST=`verity mode=create alg=sha1 payload=img hashtree=hash salt=random` outputs a random salt each time

Change-Id: Iee631a1eb72945a011d4c64c930b1331330f32cd
Commit-Ready: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: Dylan Reid <>
2 files changed