[issue29120] Move hash randomisation initialisation out of Python/random.c

2018-01-28 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, but the reason they're here rather than in the os module where you might otherwise expect to find them is because the hash randomization bootstrapping needs them. -- ___ Python tracker

[issue29120] Move hash randomisation initialisation out of Python/random.c

2018-01-27 Thread STINNER Victor
STINNER Victor added the comment: I prefered random.c name since hash initialization is only a small part of the file, most of file is the implementation of os.urandom() and os.getrandom() which is used a runtime. -- ___

[issue29120] Move hash randomisation initialisation out of Python/random.c

2018-01-27 Thread Nick Coghlan
Nick Coghlan added the comment: As part of the startup sequence refactoring, this file has been renamed to Python/bootstrap_hash.c, and _PyRandom_Init/Fini have been renamed to _Py_HashRandomization_Init/Fini. Relevant commit:

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread Nick Coghlan
Nick Coghlan added the comment: On 1 Jan 2017 05:00, "Raymond Hettinger" wrote: It would be nice if Python/random.c were renamed to something else that indicated its relation to urandom and to hash secrets. Right, based on Victor & Serhiy's feedback, the split I would

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, I concur with Nick's initial observation that the current "API naming looks like it relates to initialising the random module, when it has nothing to do with that." It would be nice if Python/random.c were renamed to something else that indicated

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread STINNER Victor
STINNER Victor added the comment: Nick: As Serhiy explained, IMHO you misunderstood _PyRandom_Init() and _PyRandom_Fini(), I suggest to close the issue. -- ___ Python tracker

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually _PyRandom_Fini() has a relation to _PyOS_URandom APIs. It releases resources acquired by _PyOS_URandom APIs. It shouldn't be renamed to _Py_HashRandomization_Fini. _PyRandom_Init() just initializes _Py_HashSecret. But it can't be implemented via

[issue29120] Move hash randomisation initialisation out of Python/random.c

2016-12-31 Thread Nick Coghlan
Nick Coghlan added the comment: You're right, I forgot about that part (I was mainly looking at the diffs today). Spelling out the *problem*, rather than just jumping to a specific proposed solution, the confusing code layout we currently have is: * Modules/_randommodule.c provides