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 Apr 2, 2020
1 parent 38ecf69 commit 1508a33
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 1508a33

Please sign in to comment.