The Rabbit Stream Cipher Algorithm is a relatively simple yet secure cipher and suitable for limited-resource devices. It was developed in 2003 by a Denmark Company Cryptico A/S (http://www.cryptico.com/). Numerous descriptions, analyses, and discussions of this Algorithm can be found on the Web. For example, "rabbit_p3.pdf" and "rabbit_p3source.zip" (http://www.ecrypt.eu.org/stream/p3ciphers/rabbit/).
I am very interested in porting Rabbit to MSP430F5xx which has 32-bit multiply hardware. I wonder if someone here is willing to have a joint effort to take on this small task. (By the way, I do this just for fun. No commercial application is intended.) The reference source code sited above is written in ANSI C and is designed to be applicable for CPU of all word sizes and Little- or Big-ending alike.
I have already ported the most often used procedures, "static u32 RABBIT_g_func()" and "static void RABBIT_next_state()". I think during encryption and decryption, the CPU spends more than 90% of its time executing these two procedures. They are also used repeatedly during setup.
I am currently using KickStart, the 4K limit on c-project is more than adequate for Rabbit. I have no objection to move over to CCE, but I will have to learn how to use it and I will only get the free version (I am cheap).
The g_func is called by next_state only, and the call appears only in one place inside a loop that is executed 8 times. Thus the optimizer of the compiler generates g_func inline as part of next_state. The total execution of next_state and g_func takes 1728 MCLK cycles. The total code size is 902 bytes. The stack used is 90 bytes.
Actually, I also wrote an assembly version of next_state. It is "plug compatible" with the ANSI C version compiled with KickStart for F5xx. The execution takes 726 MCLK cycles. The code size is 490 bytes. The stack is 60 bytes.
So, anyone interested in a joint effort to finish porting the rest of Rabbit to MSP430? Challenging the F5xx implementation of next_state is welcome too!
How about TI Application Eng.s? This could make F5xx look good!
-- OCY