static int hash_block_size = DEFAULT_VERITY_HASH_BLOCK;
static uint64_t data_blocks = 0;
static const char *salt_string = NULL;
-static uint64_t hash_start = 0;
+static uint64_t hash_offset = 0;
static const char *opt_uuid = NULL;
static int opt_verbose = 0;
params->data_block_size = data_block_size;
params->hash_block_size = hash_block_size;
params->data_size = data_blocks;
- params->hash_area_offset = hash_start;
+ params->hash_area_offset = hash_offset;
params->hash_type = hash_type;
params->flags = flags;
if (use_superblock) {
params.flags = flags;
- params.hash_area_offset = hash_start;
+ params.hash_area_offset = hash_offset;
r = crypt_load(cd, CRYPT_VERITY, ¶ms);
} else {
r = _prepare_format(¶ms, data_device, flags | CRYPT_VERITY_NO_HEADER);
if ((r = crypt_init(&cd, action_argv[0])))
return r;
- params.hash_area_offset = hash_start;
+ params.hash_area_offset = hash_offset;
r = crypt_load(cd, CRYPT_VERITY, ¶ms);
if (!r)
crypt_dump(cd);
{ "data-block-size", 0, POPT_ARG_INT, &data_block_size, 0, N_("Block size on the data device"), N_("bytes") },
{ "hash-block-size", 0, POPT_ARG_INT, &hash_block_size, 0, N_("Block size on the hash device"), N_("bytes") },
{ "data-blocks", 0, POPT_ARG_STRING, &popt_tmp, 1, N_("The number of blocks in the data file"), N_("blocks") },
- { "hash-start", 0, POPT_ARG_STRING, &popt_tmp, 2, N_("Starting block on the hash device"), N_("512-byte sectors") },
+ { "hash-offset", 0, POPT_ARG_STRING, &popt_tmp, 2, N_("Starting offset on the hash device"), N_("bytes") },
{ "hash", 'h', POPT_ARG_STRING, &hash_algorithm, 0, N_("Hash algorithm"), N_("string") },
{ "salt", 's', POPT_ARG_STRING, &salt_string, 0, N_("Salt"), N_("hex string") },
{ "uuid", '\0', POPT_ARG_STRING, &opt_uuid, 0, N_("UUID for device to use."), NULL },
data_blocks = ull_value;
break;
case 2:
- hash_start = ull_value * 512;
- if (hash_start / 512 != ull_value)
- r = POPT_ERROR_BADNUMBER;
+ hash_offset = ull_value;
break;
}