[pycrypto] Initial review of Thorsten's Py3k changes

Thorsten Behrens sbehrens at gmx.li
Wed Jan 19 09:27:01 CST 2011


Yes, something like that would work. That's a good idea.

I'm happy to make that change. Just waiting on Dwayne to come back on 
whether he wants me to scrap my repository and redo it (so he has one 
big commit), and then whether he'd rather have the b() wrapping done the 
way you suggest.

I also have a small change to the blowfish unit test. I added the CBC 
vector.

Thorsten

On 1/19/2011 5:26 AM, Legrandin wrote:
> I am not sure if I grasp all new stuff in Python 3, but would it possible to
> keep the test vectors as they are, and possibly change the encoding at runtime?
>
> For instance, in test_AES.py, we have:
>
> test_data = [
> ...
> ( '00112233445566778899aabbccddeeff', 'dda97ca4864cdfe06eaf70a0ec0d7191',
>    '000102030405060708090a0b0c0d0e0f1011121314151617',
>    'FIPS 197 C.2 (AES-192)' ),
> ... ]
>
> The proposed change wraps each string but the last one with b().
>
> Instead of changing the test vector line, we could have a separate
> piece of code that dynamically
> adjusts a tuple in the list in case python 3 is detected.
>
> Something along these lines, but possibly more pythonic:
>
> if python_version>2:
>     for t in test_data:
>       idx = test_data.index(t)
>       newt = tuple(b(t[0), b(t[1]), b(t[2]), t[3])
>       test_data[idx] = newt
>
>
> 2011/1/11 Thorsten Behrens<sbehrens at gmx.li>:
>> Dwayne,
>>
>> upon further thought, how would the following work for you to address
>> your concerns:
>>
>> - b('something') vs 'something': Leave literals encased in b(). To
>> assure that no malicious changes have been made, use a 30-day trial
>> version of Beyond Compare 3, which will, in it's "Text Compare"
>> function, highlight the exact changes on each line. It exists for Linux
>> and Windows. vimdiff may work just as well, of course.
>> http://www.scootersoftware.com/download.php
>>
>> - Multiple commits, too much "history of work", not enough "this is the
>> change": Would you like me to create a py3kmk2 branch, and have a single
>> commit in it with all the changes made?
>>    I don't think I am going to be very successful with rebase.
>>
>> Yours
>> Thorsten
>>
>> _______________________________________________
>> pycrypto mailing list
>> pycrypto at lists.dlitz.net
>> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>>
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>



More information about the pycrypto mailing list