Skip to content

Commit

Permalink
fixup: python can do the swap in a 1-liner
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Dec 7, 2020
1 parent 3606c67 commit 6647331
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/borg/crypto/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,7 @@ def _derive_byte_permutation(key_material):
for i in range(256):
pool, offset = divmod(pool, 256-i)
j = i + offset
tmp = perm[i]
perm[i] = perm[j]
perm[j] = tmp
perm[i], perm[j] = perm[j], perm[i]

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

0 comments on commit 6647331

Please sign in to comment.