Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
This patch should be reverted or fixed so that the Py2.5 build works
again.

It contains a disasterous search and replace error that prevents it from
compiling.  Hence, it couldn't have passed the test suite before being
checked in.  

Also, all of the project and config files need to be updated for the new
modules.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:python-checkins-
 [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
 Sent: Sunday, August 21, 2005 2:46 PM
 To: [EMAIL PROTECTED]
 Subject: [Python-checkins] python/dist/src/Modules _hashopenssl.c,
 NONE,2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE,2.1
md5module.c,
 2.35, 2.36 shamodule.c, 2.22, 2.23
 
 Update of /cvsroot/python/python/dist/src/Modules
 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32064/Modules
 
 Modified Files:
   md5module.c shamodule.c
 Added Files:
   _hashopenssl.c sha256module.c sha512module.c
 Log Message:
 [ sf.net patch # 1121611 ]
 
 A new hashlib module to replace the md5 and sha modules.  It adds
 support for additional secure hashes such as SHA-256 and SHA-512.  The
 hashlib module uses OpenSSL for fast platform optimized
 implementations of algorithms when available.  The old md5 and sha
 modules still exist as wrappers around hashlib to preserve backwards
 compatibility.


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Michael Hudson
Raymond Hettinger [EMAIL PROTECTED] writes:

 This patch should be reverted or fixed so that the Py2.5 build works
 again.

 It contains a disasterous search and replace error that prevents it from
 compiling.  Hence, it couldn't have passed the test suite before being
 checked in.  

It works for me, on OS X.  Passes the test suite, even.  I presume
you're on Windows of some kind?

 Also, all of the project and config files need to be updated for the new
 modules.

Well, yes.  But if Greg is on some unix-a-like, he can only update the
unix build files (which he has done; it's in setup.py).

Cheers,
mwh

-- 
 cube If you are anal, and you love to be right all the time, C++
   gives you a multitude of mostly untimportant details to fret about
   so you can feel good about yourself for getting them right, 
   while missing the big picture entirely   -- from Twisted.Quotes
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Raymond Hettinger] 
  This patch should be reverted or fixed so that the Py2.5 build works
  again.
 
  It contains a disasterous search and replace error that prevents it
from
  compiling.  Hence, it couldn't have passed the test suite before
being
  checked in.

[Michael Hudson]
 It works for me, on OS X.  Passes the test suite, even.  I presume
 you're on Windows of some kind?


Here's an excerpt from the check-in note for sha512module.c:

 
RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],0,0x428a2f98d728ae22ULL);
 
RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],1,0x7137449123ef65cdULL);
 
RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],2,0xb5c0fbcfec4d3b2fULL);
 
RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],3,0xe9b5dba58189dbbcULL);
 
RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],4,0x3956c25bf348b538ULL);

Perhaps OS X has some sort of Steve Jobs special constant suffix ULL
that Mr. Gates and the ANSI C folks have yet to accept ;-)  

If it works for you, then it probably means that sha512module.c was left
out of the build.  Maybe sha512module.c wasn't supposed to be checked
in?




  Also, all of the project and config files need to be updated for the
new
  modules.
 
 Well, yes.  But if Greg is on some unix-a-like, he can only update the
 unix build files (which he has done; it's in setup.py).

The project files are just text files and can be updated simply and
directly.  But yes, that is no big deal and I'll just do it for him once
the code gets to a compilable state.

Aside from the project files, there is still config.c and whatnot.  We
should put together a checklist of all the things that need to be
updated when a new module is added.


Raymond

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Gareth McCaughan
 Here's an excerpt from the check-in note for sha512module.c:
 
  
 RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],0,0x428a2f98d728ae22ULL);
 RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],1,0x7137449123ef65cdULL);
 RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],2,0xb5c0fbcfec4d3b2fULL);
 RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],3,0xe9b5dba58189dbbcULL);
 RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],4,0x3956c25bf348b538ULL);
 
 Perhaps OS X has some sort of Steve Jobs special constant suffix ULL
 that Mr. Gates and the ANSI C folks have yet to accept ;-)  

It's valid C99, meaning this is an unsigned long long.

-- 
g

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Michael Hudson
Raymond Hettinger [EMAIL PROTECTED] writes:

 [Raymond Hettinger] 
  This patch should be reverted or fixed so that the Py2.5 build works
  again.
 
  It contains a disasterous search and replace error that prevents it
 from
  compiling.  Hence, it couldn't have passed the test suite before
 being
  checked in.

 [Michael Hudson]
 It works for me, on OS X.  Passes the test suite, even.  I presume
 you're on Windows of some kind?


 Here's an excerpt from the check-in note for sha512module.c:

  
 RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],0,0x428a2f98d728ae22ULL);
  
 RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],1,0x7137449123ef65cdULL);
  
 RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],2,0xb5c0fbcfec4d3b2fULL);
  
 RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],3,0xe9b5dba58189dbbcULL);
  
 RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],4,0x3956c25bf348b538ULL);

 Perhaps OS X has some sort of Steve Jobs special constant suffix ULL
 that Mr. Gates and the ANSI C folks have yet to accept ;-)  

It's an C99 unsigned long long literal, AFAICT (p70 of the PDF I found
lying around somewhere...), so I think it's just Bill who's behind.
However, Python doesn't require C99, so it's pretty dodgy code by our
standards.

Hmm.  You have PY_LONG_LONG #define-d, right?  Does VC++ 6 (that's
what you use, right?) support any kind of long long literal?

 If it works for you, then it probably means that sha512module.c was left
 out of the build.

Nope: 

[EMAIL PROTECTED] build-debug]$ ./python.exe 
Python 2.5a0 (#1, Aug 23 2005, 13:24:32) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type help, copyright, credits or license for more information.
 import _sha512
[44297 refs]

 Maybe sha512module.c wasn't supposed to be checked in?

I think if you have a sufficiently modern openssl it's unnecessary.

 The project files are just text files and can be updated simply and
 directly.  But yes, that is no big deal and I'll just do it for him once
 the code gets to a compilable state.

 Aside from the project files, there is still config.c and whatnot.

Does anything need to be done there?  Oh, PC/config.c, right?

 We should put together a checklist of all the things that need to be
 updated when a new module is added.

Sounds like it! :)

Cheers,
mwh

-- 
  This makes it possible to pass complex object hierarchies to
  a C coder who thinks computer science has made no worthwhile
  advancements since the invention of the pointer.
   -- Gordon McMillan, 30 Jul 1998
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Thomas Heller
Michael Hudson [EMAIL PROTECTED] writes:

 Raymond Hettinger [EMAIL PROTECTED] writes:

 [Raymond Hettinger] 
  This patch should be reverted or fixed so that the Py2.5 build works
  again.
 
  It contains a disasterous search and replace error that prevents it
 from
  compiling.  Hence, it couldn't have passed the test suite before
 being
  checked in.

 [Michael Hudson]
 It works for me, on OS X.  Passes the test suite, even.  I presume
 you're on Windows of some kind?


 Here's an excerpt from the check-in note for sha512module.c:

  
 RND(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],0,0x428a2f98d728ae22ULL);
  
 RND(S[7],S[0],S[1],S[2],S[3],S[4],S[5],S[6],1,0x7137449123ef65cdULL);
  
 RND(S[6],S[7],S[0],S[1],S[2],S[3],S[4],S[5],2,0xb5c0fbcfec4d3b2fULL);
  
 RND(S[5],S[6],S[7],S[0],S[1],S[2],S[3],S[4],3,0xe9b5dba58189dbbcULL);
  
 RND(S[4],S[5],S[6],S[7],S[0],S[1],S[2],S[3],4,0x3956c25bf348b538ULL);

 Perhaps OS X has some sort of Steve Jobs special constant suffix ULL
 that Mr. Gates and the ANSI C folks have yet to accept ;-)  

 It's an C99 unsigned long long literal, AFAICT (p70 of the PDF I found
 lying around somewhere...), so I think it's just Bill who's behind.
 However, Python doesn't require C99, so it's pretty dodgy code by our
 standards.

 Hmm.  You have PY_LONG_LONG #define-d, right?  Does VC++ 6 (that's
 what you use, right?) support any kind of long long literal?

The suffix seems to be 'ui64'.  From vc6 limits.h:

#if _INTEGRAL_MAX_BITS = 64
/* minimum signed 64 bit value */
#define _I64_MIN(-9223372036854775807i64 - 1)
/* maximum signed 64 bit value */
#define _I64_MAX  9223372036854775807i64
/* maximum unsigned 64 bit value */
#define _UI64_MAX 0xui64
#endif


Thomas

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Michael Hudson]
 It's an C99 unsigned long long literal, AFAICT (p70 of the PDF I found
 lying around somewhere...), so I think it's just Bill who's behind.
 However, Python doesn't require C99, so it's pretty dodgy code by our
 standards.

More than just dodgy.  
Except from PEP 7:

  Use ANSI/ISO standard C (the 1989 version of the standard).


Raymond

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Gregory P. Smith
 This patch should be reverted or fixed so that the Py2.5 build works
 again.
 
 It contains a disasterous search and replace error that prevents it from
 compiling.  Hence, it couldn't have passed the test suite before being
 checked in.  
 
 Also, all of the project and config files need to be updated for the new
 modules.

It passes fine on linux.  I don't have a windows dev environment.

regardless, the quick way to work around the sha512 on windows issue
is to comment it out in setup.py and comment out the sha384 and sha512
tests in test_hashlib.py and commit that until the complation issues
are worked out.

-g

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:python-checkins-
  [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
  Sent: Sunday, August 21, 2005 2:46 PM
  To: [EMAIL PROTECTED]
  Subject: [Python-checkins] python/dist/src/Modules _hashopenssl.c,
  NONE,2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE,2.1
 md5module.c,
  2.35, 2.36 shamodule.c, 2.22, 2.23
  
  Update of /cvsroot/python/python/dist/src/Modules
  In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32064/Modules
  
  Modified Files:
  md5module.c shamodule.c
  Added Files:
  _hashopenssl.c sha256module.c sha512module.c
  Log Message:
  [ sf.net patch # 1121611 ]
  
  A new hashlib module to replace the md5 and sha modules.  It adds
  support for additional secure hashes such as SHA-256 and SHA-512.  The
  hashlib module uses OpenSSL for fast platform optimized
  implementations of algorithms when available.  The old md5 and sha
  modules still exist as wrappers around hashlib to preserve backwards
  compatibility.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Terry Reedy

Raymond Hettinger [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Except from PEP 7:

  Use ANSI/ISO standard C (the 1989 version of the standard).

Just checked (PB, Standard C): only one L allowed, not two.  But with C99 
compilers becoming more common, accidental usages of C99-isms in submitted 
code will likely become more common, especially when there is not a 
graceful C89 alternative.  While the current policy should be followed 
while it remains the policy,  it may need revision someday.

Terry J. Reedy



___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Gregory P. Smith
 The project files are just text files and can be updated simply and
 directly.  But yes, that is no big deal and I'll just do it for him once
 the code gets to a compilable state.

I just checked in an update removing all of the ULLs.  Could you check
that it compiles on windows and passes test_hashlib.py now?

It does leave gcc 3.x users with a big mess of compiler warnings to
deal with but those can be worked around once the build is actually
working everywhere.

thanks.
Greg

 Aside from the project files, there is still config.c and whatnot.  We
 should put together a checklist of all the things that need to be
 updated when a new module is added.

that'd be helpful. :)

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Martin v. Löwis
Terry Reedy wrote:
 Just checked (PB, Standard C): only one L allowed, not two.  But with C99 
 compilers becoming more common, accidental usages of C99-isms in submitted 
 code will likely become more common, especially when there is not a 
 graceful C89 alternative.  While the current policy should be followed 
 while it remains the policy,  it may need revision someday.

I think Python switched to C89 in 1999 (shortly before C99 was
published, IIRC). So the canonical time for switching to C99 would
be in 2009, provided all interesting compilers have implemented it
by then, atleast to the degree that Python would typically need.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] [Python-checkins] python/dist/src/Modules _hashopenssl.c, NONE, 2.1 sha256module.c, NONE, 2.1 sha512module.c, NONE, 2.1 md5module.c, 2.35, 2.36 shamodule.c, 2.22, 2.23

2005-08-23 Thread Raymond Hettinger
[Gregory P. Smith]
 I just checked in an update removing all of the ULLs.  Could you check
 that it compiles on windows and passes test_hashlib.py now?

Okay, all is well.


Raymond

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com