Zero-fill shift

Paul Rubin http
Wed May 5 14:51:37 EDT 2004


Daniel Orner <cs993442 at cs.yorku.ca> writes:
> while(n-- > 0)
> {   sum += delta;
>      y += (z << 4)+a ^ z + sum ^ (z >>> 5) + b;
>      z += (y << 4)+c ^ y + sum ^ (y >>> 5) + d;
> }

That's Wheeler and Needham's Tiny Encryption Algorithm (TEA).  You can
just AND the intermediate results with 0xffffffff as needed, but
unless you're trying to interoperate with some other program that
uses that algorithm, you're better off using a different algorithm.
There's plenty to choose from that are already implemented in Python
or as Python extensions.



More information about the Python-list mailing list