[pycrypto] Building pycrypto on HP-UX 11.31

Dwayne Litzenberger dlitz at dlitz.net
Thu Feb 21 01:04:24 PST 2013


On 02/20/2013 03:57 PM, Andrew Cooper wrote:
>
> On 20/02/2013 14:14, Adam Woodbeck wrote:
>> Has anyone successfully built pycrypto 2.6 on HP-UX 11.31?  I'm 
>> having a slight struggle with the build process, the latest of which 
>> are the following errors:
>>
>> "src/hash_SHA2.h", line 91: error #2020: identifier "U32" is undefined
>>   typedef U32 sha2_word_t;
>>
>> "src/hash_SHA2_template.c", line 175: error #2020: identifier "U8" is 
>> undefined
>>   hash_update (hash_state *self, const U8 *buf, int len)
>>
>> 2 errors detected in the compilation of "src/SHA256.c".
> Probably worth using uint32_t and uint8_t respectively, as they 
> substantially more standard than U32 and U8 in the world of C.
I think the problem is in src/hash_SHA2.h.  There's no #else case, and 
there probably should be:

    /* determine fixed size types */
    #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
    #include <stdint.h>
    typedef uint8_t                U8;
    typedef uint32_t            U32;
    typedef uint64_t            U64;
    #elif defined(_MSC_VER)
    typedef unsigned char        U8;
    typedef unsigned __int64    U64;
    typedef unsigned int        U32;
    #elif defined(__sun) || defined(__sun__)
    #include <sys/inttypes.h>
    typedef uint8_t                U8;
    typedef uint32_t            U32;
    typedef uint64_t            U64;
    #endif

Actually, the problem is that there are a bunch of different ways that 
integer types are being defined in PyCrypto.  Time to move this over to 
a common include file and let autoconf figure out the details.

Adam, could you pull the hpux-wip branch of pycrypto, run "python 
setup.py build test" and see if it works with my changes?  (Don't derive 
your own branches on top of -wip branches, though, since I delete/rebase 
them often!)

Basic instructions are as follows:

     git clone https://github.com/dlitz/pycrypto
     cd pycrypto
     git checkout hpux-wip
     python setup.py build test

Alternatively, if you don't have git installed, you can do this:

     # somehow download and unzip 
https://github.com/dlitz/pycrypto/archive/11559ddebbba3a4d4552a5038392d1cbaf11fbe6.zip
     cd pycrypto-1159dd*
     python setup.py build test

If this works, I'll apply the changes to the master branch and include 
it in the next release.

Cheers,
- Dwayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20130221/c45cca29/attachment.html>


More information about the pycrypto mailing list