6 case $# in 1) ;; *) echo >&2 "usage: $prog DEV"; exit 127 ;; esac
9 typeset -i sz; sz=$(blockdev --getsize64 "$dev")
12 ## Figure out a useful block size.
13 typeset -i bsz=1 nb=$sz
17 0) bsz=$((bsz*i)) nb=$((nb/i)) ;;
20 if (( bsz >= 65536 )); then break 2; fi
23 echo >&2 "$prog: using $nb blocks of size $bsz"
25 ## Write the initial stream.
26 echo >&2 "$prog: writing pseudorandom pattern..."
27 rspit salsa20/8 -H$k -z$sz -pT | \
28 dd status=none iflag=fullblock oflag=direct bs=$bsz count=$nb of="$dev"
29 echo >&2 "$prog: writing pseudorandom pattern... done"
31 ## Read the stream back, and check against the reference.
32 echo >&2 "$prog: checking pseudorandom pattern..."
33 cmp <(rspit salsa20/8 -H$k -z$sz -pT) \
34 <(dd status=none iflag=direct bs=$bsz count=$nb if="$dev")
35 echo >&2 "$prog: checking pseudorandom pattern... done"
36 echo >&2 "$prog: all ok"