use_hasher = None
chunks = []
for (slab, hasher_ref) in group:
- slab_end = min(slab.entity_offset + len(slab.sectors) * sector_size, torrent_len)
+ if slab.crypt_key is not None:
+ raise NotImplementedError("verify of encrypted data")
+ slab_end = min(slab.entity_offset + len(slab.sectors) * sector_size, torrent_len)
while offset is None or offset < slab_end:
if offset is not None and slab.entity_offset > offset:
if chunks:
)
) as sector,
entity.length as entity_length
- substring(hashes, generate_series(0, octet_length(hashes) / 32 - 1, 32), 32) as hash
+ substring(hashes, generate_series(0, octet_length(hashes) / 32 - 1, 32), 32) as hash,
+ crypt_key
from (
entityv2_leaf_hashes elh
join slab_plus on (
""",
{"block_size": _V2_BLOCK_SIZE, "disk_id": disk_id}
)
- for (entity_id, piece_num, sector, entity_len, hash_) in cursor:
+ for (entity_id, piece_num, sector, entity_len, hash_, crypt_key) in cursor:
+ if crypt_key is not None:
+ raise NotImplementedError("verify of encrypted data")
+
read_start = sector * _V2_BLOCK_SIZE
read_end = read_start + min(_V2_BLOCK_SIZE, entity_len - piece_num * _V2_BLOCK_SIZE)
disk_file.seek(read_start)