Results 1 to 2 of 2
Thread: Galois Multiplication
- 01-03-2012, 11:17 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 92
- Rep Power
- 0
Galois Multiplication
Righto! I've been writing my implementation of the Rijndal cipher, and I've got stuck on one particular part. the "mixColumns()" method to be exact. Basically,
at first i was using lookup tables from wikipedia. Then I was having problems with the values my implementation was churning out. Anyhow, after some headache I wrote a function that multiplies over Rijndael's finite field, GF(2^8), and implemented it. Then to test it, I compared it to a step by step guide that I found here. Now I'm having a bit of an issue. The lookup tables, and my function for multiplying in GF(2^8) are churning out the same numbers, and the guide is showing me something different. Basically, according to the guide:
d4 * 02 = 04 in Rijndael's finite field, however to the lookup table and my function, it's b3. I'm assuming the guide is right, it's from the cs website, so it's a credible source. I just want to know what I'm doing wrong.
Above is my multiplication function. I reckon that works fine, and that is returning b3 for my values as well, same with my lookup table, which can be found here. In this case, it's the table for multiplying by 2.Java Code:private int galoisMultiply(int a, int b) { int p = 0; for (int n=0; n<8; n++) { p = ((b & 0x01) > 0) ? p^a : p; boolean ho = ((a & 0x80) > 0); a = ((a<<1) & 0xFE); if (ho) a = a ^ 0x1b; b = ((b>>1) & 0x7F); } return p; }
I need either someone to talk me through Galois Multiplication, or perhaps someone can help me by looking at the tables and vouching for their credibility. Seriously am stuck for ideas at the moment and I would really love it if you guys could help me out here!
- 01-04-2012, 02:13 PM #2
Member
- Join Date
- Oct 2011
- Posts
- 92
- Rep Power
- 0
Similar Threads
-
need help with multiplication
By dakid2 in forum New To JavaReplies: 10Last Post: 03-08-2011, 03:41 AM -
Multiplication code
By bomboy in forum EclipseReplies: 2Last Post: 12-28-2010, 01:11 PM -
Multiplication Table
By BillyB in forum New To JavaReplies: 17Last Post: 12-24-2010, 06:58 AM -
need help with this: multiplication table
By MsIceCold in forum New To JavaReplies: 7Last Post: 07-13-2010, 01:31 PM -
Help with Multiplication
By phil028 in forum New To JavaReplies: 1Last Post: 12-06-2007, 07:39 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks