COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### C programming, need help..

• Email
• Follow

```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^8) 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! ]

```
 0
Reply watija (10) 3/14/2005 9:02:22 AM

See related articles to this posting

```Tiza Naziri wrote:
> 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^8) 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! ]
```
 0
Reply Ben 3/14/2005 9:34:15 PM

```"Tiza Naziri" <watija@yahoo.com> wrote in message
news:1110770293.226111.62950@g14g2000cwa.googlegroups.com...
> 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! ]

```
 0
Reply Marcin 3/15/2005 8:34:17 PM

2 Replies
189 Views

Similar Articles

12/10/2013 8:31:21 AM
[PageSpeed]

 Reply:

Similar Artilces: