Re: (long) An AES implementation for 32-bit platforms

From: Mok-Kong Shen (mok-kong.shen_at_t-online.de)
Date: 06/11/03


Date: Wed, 11 Jun 2003 00:10:57 +0200


Addendum: A few points of clarification:

(1) The copyright notice is so formulated so as to
    gather informations of its practical use, in
    particular matters concering possibilities of
    efficiency enhancements or eventual bug reports,
    to enable its further improvements in furture
    (major) versions to be centrally distributed by
    me to all who are interested in it (via this group).
   
(2) The code has been carefully (as far as I personally
    could) written to be easily readable, instead of
    employing by all means complicated coding techniques
    for the purpose of squeezing out efficiencies. This
    should facilitate visual checking of its logic and
    renders its maintenance simple. (Also I don't use
    conditional compiler directives or macros, which in
    my personal experience are not very contributive to
    easy understanding of codes.) I had in fact an
    optimized version of one of the functions that is
    needed in key expansions. Since I consider that one
    likely changes keys relatively seldom in comparison
    to processing of the blocks, I opted for using the
    straightforward code for that function, so that those
    readers who desire to have a proper understanding of
    the code before venturing to use it wouldn't have
    difficulties therefrom.

(3) Until recently, I never wanted to implement AES
    and had also not known how many implementations
    are freely available to all. I was surprised, as
    I looked at page that provides a survey of
    diverse implementations. This convinced me that
    there may be a place for another implementation
    that could be straightforwardly used by a large
    number of people on the most porpular hardware
    type at least. (I don't have a big-endian
    hardware to test the code, but I am confident
    that there shouldn't be problems arising from
    endian-ness. 'Bit-sex' is a different issue,
    which could eventually need conversion of the
    individual bytes on external data exchange media
    or equivalent measure. Cf. the topic of network
    standard format.)

(4) As said, part of the initiative for doing the work
    comes from discussions in another recent thread.
    I wanted to actually see whether a straightforward
    (possibly naive)interpretation of the FIPS document
    is or isn't sufficient by itself for working out a
    concrete byte-array implementation. (There were
    opinions whether endian-ness of hardware could be
    an issue in this context. In retrospect I believe
    that that verification wouldn't be necessary. Anyway,
    for one thing, AES is, as is well-known, also
    intended for implementation on 8-bit processors and
    there isn't an endian-ness issue (in the proper sense
    i.e. concerning ordering of bytes in a word) on such
    computers.)

(5) Anybody having difficulties in using my code but not
    desiring to post the problems to the group could
    e-mail me directly. (Should there be bugs found, I
    would certainly inform the group.)

M. K. Shen



Relevant Pages

  • Re: Cohens paper on byte order
    ... AES implementation myself, let me hypothetically ... assume that I am the programmer responsible for AES ... has a number of different hardware and that I don't ... I know that no conversion is needed. ...
    (sci.crypt)
  • Re: Cohens paper on byte order
    ... that has nothing to do with the AES specification ... > of such differences in hardware formats and ensure that ... > the value of the octet, 0xpq, is correctly transported. ... with the ability to exchange external data. ...
    (sci.crypt)
  • Re: Cohens paper on byte order
    ... hence repeatedly wrote about the conversion issue until ... > AES specification in FIPS-197 actually is. ... // Retrieve the bits from bt into the array bita. ... since we are working with the same type of hardware ...
    (sci.crypt)
  • Re: Cohens paper on byte order
    ... >> principle it is an issue as soon as more than one bit is involved. ... > sees the effect of endian-ness ... > are in the containers of type 'unsigned char', ... of interoperability with different hardware. ...
    (sci.crypt)
  • Re: RC4 on AMD64
    ... > Tom St Denis wrote: ... RC4 in hardware is just as insecure as RC4 in software??? ... AES is actually a simpler algorithm. ...
    (sci.crypt)