Crotchfire
New member
I've been putting together my own implementation of the X11 algorithm by trying to reverse engineer stuff I find off Git... but I'm trying to understand what's going on as I do this and that certainly slows things down 
Anyway, the code that I've been using as my reference has an AES round implementation (Echo and Shavite) that uses a set of 4 lookup tables (each table contains 256 32bit integers). The code of interest looks like:
y0 = AES0[(x0)& 0xFF]
^ AES1[(x1 >> 8) & 0xFF]
^ AES2[(x2 >> 16) & 0xFF]
^ AES3[(x3 >> 24) & 0xFF];
y1 = AES0[(x1)& 0xFF]
^ AES1[(x2 >> 8) & 0xFF]
^ AES2[(x3 >> 16) & 0xFF]
^ AES3[(x0 >> 24) & 0xFF];
y2 = AES0[(x2)& 0xFF]
^ AES1[(x3 >> 8) & 0xFF]
^ AES2[(x0 >> 16) & 0xFF]
^ AES3[(x1 >> 24) & 0xFF];
y3 = AES0[(x3)& 0xFF]
^ AES1[(x0 >> 8) & 0xFF]
^ AES2[(x1 >> 16) & 0xFF]
^ AES3[(x2 >> 24) & 0xFF];
I did a little bit of googling to see what I could find out about AES, and there's a fair amount to read up on, it seems. I did find that in MSVS 2010 (what I'm currently using), there are a number of AES functions already available to me (I'd provide a link, but this is my first post and the forums are understandably worried about links from first-time posters. Look up AES Intrinsics on MSDN).
My question is this: can the behavior of that code snippet I've put up be reproduced with those AES Intrinsics? Without the lookup tables?
I suspect they can, and I have a little bit of an idea how, but I figured I'd ask around a place like this to try and cut to the chase
Note: I'm not convinced that I ought to keep or do away with the lookup tables; here I'm really just trying to better my understanding about how things are put together. That said, I'm certainly open to hearing opinions about why you think I should or shouldn't.
Anyway, the code that I've been using as my reference has an AES round implementation (Echo and Shavite) that uses a set of 4 lookup tables (each table contains 256 32bit integers). The code of interest looks like:
y0 = AES0[(x0)& 0xFF]
^ AES1[(x1 >> 8) & 0xFF]
^ AES2[(x2 >> 16) & 0xFF]
^ AES3[(x3 >> 24) & 0xFF];
y1 = AES0[(x1)& 0xFF]
^ AES1[(x2 >> 8) & 0xFF]
^ AES2[(x3 >> 16) & 0xFF]
^ AES3[(x0 >> 24) & 0xFF];
y2 = AES0[(x2)& 0xFF]
^ AES1[(x3 >> 8) & 0xFF]
^ AES2[(x0 >> 16) & 0xFF]
^ AES3[(x1 >> 24) & 0xFF];
y3 = AES0[(x3)& 0xFF]
^ AES1[(x0 >> 8) & 0xFF]
^ AES2[(x1 >> 16) & 0xFF]
^ AES3[(x2 >> 24) & 0xFF];
I did a little bit of googling to see what I could find out about AES, and there's a fair amount to read up on, it seems. I did find that in MSVS 2010 (what I'm currently using), there are a number of AES functions already available to me (I'd provide a link, but this is my first post and the forums are understandably worried about links from first-time posters. Look up AES Intrinsics on MSDN).
My question is this: can the behavior of that code snippet I've put up be reproduced with those AES Intrinsics? Without the lookup tables?
I suspect they can, and I have a little bit of an idea how, but I figured I'd ask around a place like this to try and cut to the chase
Note: I'm not convinced that I ought to keep or do away with the lookup tables; here I'm really just trying to better my understanding about how things are put together. That said, I'm certainly open to hearing opinions about why you think I should or shouldn't.