 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tiza Naziri Guest
|
Posted: Mon Mar 14, 2005 9:02 am Post subject: C programming, need help.. |
|
|
Hi,
I'm Siti Zarina from Malaysia. Currently I involve in a research
project on Advanced Encryption Standard (AES).
I'm not really good in C/C++ programming. I need some advice on how to
represent the finite field GF(2^ operations (such as addition,
inversion, multiplication) in binary representation in C language.
Another thing is how to represent the pseudocode for generating
multiplicative inverse below:
remainder[1] = f(x)
remainder[2] = a(x)
auxiliary[1] = 0
auxiliary[2] = 1
i = 2
do while remainder[i] <> 1
i = i + 1
remainder[i] = remainder(remainder[i-2] / remainder[i-1])
quotient[i] = quotient(remainder[i-2] / remainder[i-1])
auxiliary[i] = quotient[i] * auxiliary[i-1] + auxiliary[i-2]
inverse = auxiliary[i]
For AES, the f(x) = x^8 + x^4 + x^3 + x + 1.
Consideration and help is greatly appreciated.
Thank you.
Regards.
Siti Zarina
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ben Hutchings Guest
|
Posted: Mon Mar 14, 2005 9:34 pm Post subject: Re: C programming, need help.. |
|
|
Tiza Naziri wrote:
| Quote: | Hi,
I'm Siti Zarina from Malaysia. Currently I involve in a research
project on Advanced Encryption Standard (AES).
I'm not really good in C/C++ programming. I need some advice on how to
represent the finite field GF(2^ operations (such as addition,
inversion, multiplication) in binary representation in C language.
snip |
C and C++ are quite different languages. A natural implementation of
an algorithm in C++ may well not be valid C code. If you need C
code, this is not the place to ask.
--
Ben Hutchings
Having problems with C++ templates? Your questions may be answered by
<http://womble.decadentplace.org.uk/c++/template-faq.html>.
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Marcin Mañk Guest
|
Posted: Tue Mar 15, 2005 8:34 pm Post subject: Re: C programming, need help.. |
|
|
"Tiza Naziri" <watija (AT) yahoo (DOT) com> wrote
| Quote: | Hi,
I'm Siti Zarina from Malaysia. Currently I involve in a research
project on Advanced Encryption Standard (AES).
|
Hello
There are many C implementations of AES on the web (from very verbose to
very speed-optimized) . Browsing the code would give you many hints.
Also try searching under 'rijndael' .
Greetings
Marcin
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|