-}
-
-record_hashes inner "${hashes[@]}" | go "$first_layer" | record_hashes outer "${hashes[@]}"
-
-if [[ "$mode" == e ]];then
- # Add the hashes to keyfile
- key_aside_dir=$(mktemp -d "$keyfile.XXXXXXXXXX")
- key_aside="$key_aside_dir/key.orig"
- mv "$keyfile" "$key_aside"
- cat "$hash_dir"/outer-* "$key_aside" "$hash_dir"/inner* > "$keyfile"
- shred -u "$key_aside"
- rmdir "$key_aside_dir"
-else
- # Verify the hashes
- for hash_result in "$hash_dir"/*;do
- verify_hash "$hash_result" || die "Hash check $(basename "$hash_result") failed"
- done
-fi