DES encryption algorithm
Carey Evans
careye at spamcop.net
Sat Jan 19 22:23:52 EST 2002
More information about the Python-list mailing list
Sat Jan 19 22:23:52 EST 2002
- Previous message (by thread): DES encryption algorithm
- Next message (by thread): DES encryption algorithm
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Joshua Muskovitz" <joshm at taconic.net> writes: > Here is a handy function for handling right shift. Replace all occurrances > of x >> y in your code with rshift(x, y). Note that: 1. Function call in Python is relatively expensive, and there are a lot of right shifts in DES. 2. At least in the DES implementation I ported, all the right shifts were by constant amounts, so I could expand them inline to something like ((t >> 18) & 0x3fff). 3. A good bit of the code was right-shifting 28-bit numbers, where the top bit was always zero, so no change was needed. -- Carey Evans http://home.clear.net.nz/pages/c.evans/ Cavem canus.
- Previous message (by thread): DES encryption algorithm
- Next message (by thread): DES encryption algorithm
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list