Debian Codegraph @

debian/patches/d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch

raw symbols SCIP
1 Fromscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/patches/`d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch`#From.: Justin Turner Arthur <[email protected]scip-debian . . . identity/`[email protected]`.>
2 Datescip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/patches/`d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch`#Date.: Mon, 9 Apr 2018 03:20:00 -0500
3 Originscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/patches/`d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch`#Origin.: https://github.com/dlitz/python-pbkdf2/pull/5/commits/d9b45bcedd4ce414bfb9403fda3e6868a791b717
4 Forwardedscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/patches/`d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch`#Forwarded.: no (PR in Github)
5 Subjectscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/patches/`d9b45bcedd4ce414bfb9403fda3e6868a791b717.patch`#Subject.: [PATCH] Use faster all-at-once xor on Python 3.2+.
6
7 ---
8 pbkdf2.py | 12 ++++++++++--
9 1 file changed, 10 insertions(+), 2 deletions(-)
10
11 diff --git a/pbkdf2.pyscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/upstream/`pbkdf2.py`: b/pbkdf2.pyscip-debian debian python-pbkdf2 1.3+20110614.git2a0fb15-1 python-pbkdf2/upstream/`pbkdf2.py`:
12 index 937a99a..6adc96f 100644
13 --- a/pbkdf2.py
14 +++ b/pbkdf2.py
15 @@ -101,8 +101,16 @@ def callable(obj):
16 return hasattr(obj, '__call__')
17 def b(s):
18 return s.encode("latin-1")
19 - def binxor(a, b):
20 - return bytes([x ^ y for (x, y) in zip(a, b)])
21 + if hasattr(int, 'to_bytes') and hasattr(int, 'from_bytes'):
22 + _sys_byteorder = sys.byteorder
23 + _b2i = int.from_bytes
24 + def binxor(a, b):
25 + a_int = _b2i(a, _sys_byteorder)
26 + b_int = _b2i(b, _sys_byteorder)
27 + return (a_int ^ b_int).to_bytes(len(a), _sys_byteorder)
28 + else:
29 + def binxor(a, b):
30 + return bytes([x ^ y for (x, y) in zip(a, b)])
31 from base64 import b64encode as _b64encode
32 def b64encode(data, chars="+/"):
33 if isunicode(chars):