Staging
v0.5.1
https://github.com/python/cpython
Revision 31729366e2bc09632e78f3896dbce0ae64914f28 authored by Devin Jeanpierre on 21 November 2020, 08:55:23 UTC, committed by GitHub on 21 November 2020, 08:55:23 UTC
* bpo-40791: Make compare_digest more constant-time.

The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization.

(This is change #1 from https://bugs.python.org/issue40791 .)
1 parent aa3a352
History
Tip revision: 31729366e2bc09632e78f3896dbce0ae64914f28 authored by Devin Jeanpierre on 21 November 2020, 08:55:23 UTC
bpo-40791: Make compare_digest more constant-time. (GH-20444)
Tip revision: 3172936
File Mode Size
_blake2
_ctypes
_decimal
_io
_multiprocessing
_sha3
_sqlite
_ssl
_xxtestfuzz
cjkcodecs
clinic
expat
README -rw-r--r-- 112 bytes
Setup -rw-r--r-- 14.6 KB
_abc.c -rw-r--r-- 23.6 KB
_asynciomodule.c -rw-r--r-- 87.2 KB
_bisectmodule.c -rw-r--r-- 8.0 KB
_bz2module.c -rw-r--r-- 23.8 KB
_codecsmodule.c -rw-r--r-- 32.4 KB
_collectionsmodule.c -rw-r--r-- 78.9 KB
_contextvarsmodule.c -rw-r--r-- 1.6 KB
_cryptmodule.c -rw-r--r-- 1.6 KB
_csv.c -rw-r--r-- 49.6 KB
_curses_panel.c -rw-r--r-- 18.5 KB
_cursesmodule.c -rw-r--r-- 133.8 KB
_datetimemodule.c -rw-r--r-- 218.1 KB
_dbmmodule.c -rw-r--r-- 14.6 KB
_elementtree.c -rw-r--r-- 124.0 KB
_functoolsmodule.c -rw-r--r-- 45.8 KB
_gdbmmodule.c -rw-r--r-- 20.9 KB
_hashopenssl.c -rw-r--r-- 53.2 KB
_heapqmodule.c -rw-r--r-- 21.8 KB
_json.c -rw-r--r-- 57.5 KB
_localemodule.c -rw-r--r-- 22.3 KB
_lsprof.c -rw-r--r-- 25.7 KB
_lzmamodule.c -rw-r--r-- 48.2 KB
_math.c -rw-r--r-- 7.3 KB
_math.h -rw-r--r-- 1007 bytes
_opcode.c -rw-r--r-- 2.1 KB
_operator.c -rw-r--r-- 45.4 KB
_pickle.c -rw-r--r-- 228.9 KB
_posixsubprocess.c -rw-r--r-- 39.0 KB
_queuemodule.c -rw-r--r-- 12.0 KB
_randommodule.c -rw-r--r-- 17.5 KB
_scproxy.c -rw-r--r-- 6.1 KB
_sre.c -rw-r--r-- 77.5 KB
_ssl.c -rw-r--r-- 186.1 KB
_ssl_data.h -rw-r--r-- 203.1 KB
_stat.c -rw-r--r-- 15.2 KB
_statisticsmodule.c -rw-r--r-- 4.8 KB
_struct.c -rw-r--r-- 68.4 KB
_testbuffer.c -rw-r--r-- 82.2 KB
_testcapimodule.c -rw-r--r-- 211.9 KB
_testimportmultiple.c -rw-r--r-- 1.1 KB
_testinternalcapi.c -rw-r--r-- 7.7 KB
_testmultiphase.c -rw-r--r-- 22.2 KB
_threadmodule.c -rw-r--r-- 49.9 KB
_tkinter.c -rw-r--r-- 93.3 KB
_tracemalloc.c -rw-r--r-- 44.8 KB
_uuidmodule.c -rw-r--r-- 3.0 KB
_weakref.c -rw-r--r-- 4.9 KB
_winapi.c -rw-r--r-- 59.6 KB
_xxsubinterpretersmodule.c -rw-r--r-- 68.1 KB
_zoneinfo.c -rw-r--r-- 73.6 KB
addrinfo.h -rw-r--r-- 5.9 KB
arraymodule.c -rw-r--r-- 87.0 KB
atexitmodule.c -rw-r--r-- 8.9 KB
audioop.c -rw-r--r-- 59.1 KB
binascii.c -rw-r--r-- 54.5 KB
cmathmodule.c -rw-r--r-- 42.3 KB
config.c.in -rw-r--r-- 1.6 KB
errnomodule.c -rw-r--r-- 27.1 KB
faulthandler.c -rw-r--r-- 39.4 KB
fcntlmodule.c -rw-r--r-- 20.5 KB
gc_weakref.txt -rw-r--r-- 11.2 KB
gcmodule.c -rw-r--r-- 75.7 KB
getaddrinfo.c -rw-r--r-- 18.4 KB
getbuildinfo.c -rw-r--r-- 1.3 KB
getnameinfo.c -rw-r--r-- 6.2 KB
getpath.c -rw-r--r-- 45.0 KB
grpmodule.c -rw-r--r-- 8.5 KB
hashlib.h -rw-r--r-- 2.1 KB
itertoolsmodule.c -rw-r--r-- 148.2 KB
ld_so_aix.in -rw-r--r-- 6.1 KB
main.c -rw-r--r-- 18.1 KB
makesetup -rwxr-xr-x 7.7 KB
makexp_aix -rwxr-xr-x 2.7 KB
mathmodule.c -rw-r--r-- 105.8 KB
md5module.c -rw-r--r-- 15.2 KB
mmapmodule.c -rw-r--r-- 47.4 KB
nismodule.c -rw-r--r-- 12.9 KB
ossaudiodev.c -rw-r--r-- 36.2 KB
overlapped.c -rw-r--r-- 53.6 KB
posixmodule.c -rw-r--r-- 408.8 KB
posixmodule.h -rw-r--r-- 837 bytes
pwdmodule.c -rw-r--r-- 8.9 KB
pyexpat.c -rw-r--r-- 58.2 KB
readline.c -rw-r--r-- 38.3 KB
resource.c -rw-r--r-- 12.9 KB
rotatingtree.c -rw-r--r-- 3.4 KB
rotatingtree.h -rw-r--r-- 924 bytes
selectmodule.c -rw-r--r-- 70.0 KB
sha1module.c -rw-r--r-- 14.4 KB
sha256module.c -rw-r--r-- 21.9 KB
sha512module.c -rw-r--r-- 26.8 KB
signalmodule.c -rw-r--r-- 47.3 KB
socketmodule.c -rw-r--r-- 242.4 KB
socketmodule.h -rw-r--r-- 8.5 KB
spwdmodule.c -rw-r--r-- 6.7 KB
sre.h -rw-r--r-- 2.8 KB
sre_constants.h -rw-r--r-- 2.8 KB
sre_lib.h -rw-r--r-- 52.1 KB
symtablemodule.c -rw-r--r-- 3.7 KB
syslogmodule.c -rw-r--r-- 10.1 KB
termios.c -rw-r--r-- 22.0 KB
testcapi_long.h -rw-r--r-- 6.8 KB
timemodule.c -rw-r--r-- 57.2 KB
tkappinit.c -rw-r--r-- 4.7 KB
tkinter.h -rw-r--r-- 881 bytes
unicodedata.c -rw-r--r-- 43.8 KB
unicodedata_db.h -rw-r--r-- 531.8 KB
unicodename_db.h -rw-r--r-- 2.1 MB
winreparse.h -rw-r--r-- 1.6 KB
xxlimited.c -rw-r--r-- 7.0 KB
xxmodule.c -rw-r--r-- 12.6 KB
xxsubtype.c -rw-r--r-- 10.8 KB
zlibmodule.c -rw-r--r-- 41.9 KB

README

back to top