[issue24318] Better documentaiton of profile-opt (and release builds in general?)

2018-04-19 Thread Joachim Wagner

Joachim Wagner <jwag...@computing.dcu.ie> added the comment:

The readme in 3.6.5 has a section on PGO but the sentence "If ran,
``make profile-opt`` will do several steps." can be misunderstood that one has 
to run this command instead of "make" after "configure --enable-optimizations". 
Furthermore, a 2015 post suggests that most Linux distributions use a different 
workload than the one provided for much better results. The readme should talk 
about this, either clarifying that this issue has been resolved or making 
recommendations for the workload. (I understand that licence incompatibilities 
or the size of the workload may be reasons for not including the recommended 
workload in the source distribution.)

--
nosy: +jwagner

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue24318>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1385] hmac module violates RFC for some hash functions, e.g. sha512

2007-11-04 Thread Joachim Wagner

New submission from Joachim Wagner:

(First time submitting a patch to this system.)
The hmac module uses a fixed blocksize of 64 bytes. This is fine for 
many hash functions like md5, sha1 and sha256, but not for sha512 or 
in the general case. The RFC referenced in the python documentation 
specifies that the blocksize has to match the hash function. The 
attached patch is the first of three proposed solutions:

1. use the undocumented block_size attribute of the hashing objects 
provided in the hashlib modules and fallback to 64 bytes if the 
attribute is missing (maybe a depreciated warning would be better); in 
this case it would be a good idea to document to block_size attribute 
(not included in the patch attached); performance could be improved by 
making block_size a class attribute

2. document that the blocksize is 64 and that the RFC is only 
correctly implemented if the hash function also has a blocksize of 64 
bytes; optionally include the workaround to subclass hmac.HMAC and 
overwrite the blocksize (this is documented in the source code, but 
unfortunately not in the python docu)

3. make the blocksize a keyword argument to the constructor and 
document that it has to match the hash function's blocksize for full 
RFC compliance

Regards,
Joachim

--
components: None
files: hmac_1.patch
messages: 57106
nosy: jowagner
severity: normal
status: open
title: hmac module violates RFC for some hash functions, e.g. sha512
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8689/hmac_1.patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1385
__--- hmac.orig	2007-11-04 17:44:46.0 +
+++ hmac.py	2007-11-04 18:31:39.0 +
@@ -48,7 +48,15 @@
 self.inner = self.digest_cons()
 self.digest_size = self.inner.digest_size
 
-blocksize = self.blocksize
+try:
+blocksize = self.digest_cons().block_size
+if blocksize  16:
+# very low blocksize
+# probably a legacy value like in Lib/sha.py
+blocksize = self.blocksize
+except AttributeError:
+blocksize = self.blocksize
+
 if len(key)  blocksize:
 key = self.digest_cons(key).digest()
 
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com