Re: (long) An AES implementation for 32-bit platforms
From: Douglas A. Gwyn (DAGwyn_at_null.net)
Date: 06/13/03
- Next message: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Previous message: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- In reply to: Mok-Kong Shen: "Re: (long) An AES implementation for 32-bit platforms"
- Next in thread: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Reply: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 13 Jun 2003 01:35:14 -0400
Mok-Kong Shen wrote:
> O.k. It isn't very well written. Would a programmer who
> uses a C compiler, which doesn't accept // as the comment
> symbol (like in your case with the 'conforming' mode set
> for a C++ compiler), consider my code to be a C code?
While //-comments were not part of Standard C before
1999, there were early implementations of this feature
in C compilers, the first that I recall being from the
Naval PostGraduate School around 1980. I added the
feature to the C compiler that I maintained (derived
from Ritchie's PDP-11 C compiler) around 1982, but
when we acquired a different system I had to provide a
conversion tool to turn such source code into /*...*/
source code instead. (That is not as easy as you may
think.)
But your source code wasn't correct C even apart from
the comment issue. However, it made no essential use
of substantial facilities that differentiate C++ from
C, so it wouldn't really be a good example of C++ code
either. The closest it came to C++ was the sloppiness
with regard to use of structure/union tags. I had to
replace those with the obvious typedefs to compile
your code under the conforming C compiler that I used
on the SPARC platform.
> (BTW, although I use VC++, I must admit that I don't
> have experience in setting conforming mode to reder it
> to be a strict C compiler. Hence I have never tested
> strict C conformance. On the other hand, I think that
> nowadays employing C++ instead of C doesn't pose any
> practical problems, as also said previously.)
Actually there are some important if "minor"
differences between the languages in the area in which
they seem to overlap. When you consider that I had to
make changes to your code to get it to compile under a
conforming C compiler, you should see the practical
effect of not paying sufficient attention to these
differences. If you want more people to use your code
without them having to make changes to it, then you
should make it as close to a strictly conforming C
program as possible. Also, parameterize obviously
system-specific attributes such as the name of that
table file, which would have been better defined via
a macro:
#ifndef TABLE_FILE /* normally set in Makefile */
#define TABLE_FILE "c:\\aes\\table.bin"
#endif
- Next message: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Previous message: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- In reply to: Mok-Kong Shen: "Re: (long) An AES implementation for 32-bit platforms"
- Next in thread: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Reply: Douglas A. Gwyn: "Re: (long) An AES implementation for 32-bit platforms"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|