Category: Issues

In plain C...

25/02/08 | by Sean O’Neil [mail] | Categories: Issues

I guess the easiest way to understand and implement EnRUPT32 as a block cipher would be something like this:

#define er1(k) (rotr(2*x[(r-1)%xw]^x[(r+1)%xw]^k^r,8)*9^k)

enRUPT (u32 *x, const u32 xw, u32 *key, const u32 kw)
{
    u32 r, s=4, n=s*(2*xw+kw);
    for (r=1; r<=n; r++) x[r%xw] ^= er1(key[r%kw]);
}

unRUPT (u32 *x, const u32 xw, u32 *key, const u32 kw)
{
    u32 r, s=4, n=s*(2*xw+kw);
    for (r=n; r   ; r--) x[r%xw] ^= er1(key[r%kw]);
}

Yes. This is it. A complete block cipher. There is nothing more to it. If it is used with arbitrary but constant 2n block sizes, it should be almost as fast as an unrolled implementation, almost as fast as the AES for the 4-word blocks and the 4-word keys.

May 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Poll

EnRUPT for SHA-3?

View Results

Q: What is EnRUPT?

A: EnRUPT is a simple scalable all-in-one block/stream cipher/hash.

Search

Categories

XML Feeds

Weather

°

Feels like: °
Wind:
Today's high: °
Today's low: °
Sunrise:
Sunset:
More...

powered by b2evolution free blog software