[tahoe-dev] [pycryptopp] #24: SHA256 failure on NetBSD with multiple segments

pycryptopp trac at allmydata.org
Fri Jul 3 12:51:28 PDT 2009


#24: SHA256 failure on NetBSD with multiple segments
----------------------+-----------------------------------------------------
Reporter:  warner     |           Owner:  bdew 
    Type:  defect     |          Status:  new  
Priority:  critical   |         Version:  0.5.1
Keywords:  integrity  |   Launchpad_bug:       
----------------------+-----------------------------------------------------

Comment(by midnightmagic):

 Replying to [comment:17 midnightmagic]:
 > I have written a test program for crypto++ which demonstrates the same
 problem for a SHA256:
 > the results differ based on whether the input is split up on an odd
 boundary or not. I have
 > compiled my crypto++ library with and (I believe) without the optimized
 assembly routines.

 I lied. Manually disabling the optimized assembly makes my sample program
 output the correct results. Here are the details:

 {{{ g++ -DCRYPTOPP_DISABLE_X86ASM -DNDEBUG -g -O2 -DCRYPTOPP_DISABLE_SSSE3
 -pipe -I. -c mytest2.cpp && g++ -o mytest2 mytest2.o -L. -lcryptopp &&
 ./mytest2 }}}

 will work and results in:

 {{{ STRING: aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 (etc)
 SHA256: 6836CF13BAC400E9105071CD6AF47084DFACAD4E5E302C94BFED24E013AFB73E
 STRING: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 (etc)
 SHA256: 6836CF13BAC400E9105071CD6AF47084DFACAD4E5E302C94BFED24E013AFB73E
 }}}

 Just build crypto++ and then plunk mytest2.cpp in the same directory as
 the libcryptopp.a was built in, and run the above.

 {{{ g++ -DNDEBUG -g -O2 -DCRYPTOPP_DISABLE_SSSE3 -pipe -I. -c mytest2.cpp
 && g++ -o mytest2 mytest2.o -L. -lcryptopp && ./mytest2 }}}

 will NOT work, and results in:

 {{{ STRING: aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 (etc)
 SHA256: D159F4747C64249633829F8355DC84678A67CCCE92ABC8F770D33111AFB43E42
 STRING: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 (etc)
 SHA256: 6836CF13BAC400E9105071CD6AF47084DFACAD4E5E302C94BFED24E013AFB73E
 }}}

-- 
Ticket URL: <http://allmydata.org/trac/pycryptopp/ticket/24#comment:18>
pycryptopp <http://allmydata.org/trac/pycryptopp>
Python bindings for the Crypto++ library


More information about the tahoe-dev mailing list