Skip to content

Commit 1508a33

Browse files
fixup: python can do the swap in a 1-liner
1 parent 38ecf69 commit 1508a33

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/borg/crypto/key.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,7 @@ def _derive_byte_permutation(key_material):
369369
for i in range(256):
370370
pool, offset = divmod(pool, 256-i)
371371
j = i + offset
372-
tmp = perm[i]
373-
perm[i] = perm[j]
374-
perm[j] = tmp
372+
perm[i], perm[j] = perm[j], perm[i]
375373

376374
if pool == 0:
377375
# the pool value was less than 256!, we have an unbiased choice

0 commit comments

Comments
 (0)