Re: Release 1.1 (beta) of my AES implementation

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


Date: Wed, 25 Jun 2003 18:28:12 +0200


Tom St Denis wrote:
>
[snip]
> Now imagine using your style of coding in a project 10 tims bigger than
> LTM....

I have only my humble code in mind. I think a candidate
application would invoke in main or a routine the
encryption/decrption functions. If that routine is
used in wide scale, it could be compiled (its source
would include my code). There is thus only a single
point referencing my code. So the include mechanism
is sufficient and o.k. in my opinion.

>
> >Or am I missing something?
>
> Yeah, post secondary education in computer science....
>
> That being said... imagine this case
>
> - one application
> - splits into two threads both use AES
> - both threads share memory space
>
> This is common, specially for your beloved win32 platform [as a note of
> interest threads are not common in unix and are emulated in Linux].
> Applications which may need to handle more than one connection [e.g.
> sockets] or handle bi-directional pipes, etc...
>
> Sure, if you intend to write single thread applications only then your
> approach works fine.
>
> My point though, is why limit yourself out of the gate? You should
> always try to write the best code you can [e.g. as portable as can be,
> as thread safe as can be, as flexible as can be, etc...].
>
> If you cripple your code out of the gate then it can only really go
> downhill from there. And to be honest "good" coding style doesn't
> involve a lot of work when you are in the habit of doing it. Makefiles
> are simple to write, proper code factoring [e.g. no code in headers] is
> simple to do, writing thread safe routines is fairly trivial, etc...
>
> You asked for comments on your code. I'm giving you the dime tour of
> what a high school grad knows in CS. Imagine if a real pro actually
> replied... whoa...

If the program does fork like you described, then the
entire code piece

    read a block from input file to aesin;
    aesprocess();
    write aesout to output file;

would need to be protected because of concurrency. So
the programmer has to do something anyway (modifications
in the sense I mentioned in the copyright notice).

M. K. Shen



Relevant Pages

  • Re: Release 1.1 (beta) of my AES implementation
    ... > Tom St Denis wrote: ... Now imagine using your style of coding in a project 10 tims bigger than ... If you cripple your code out of the gate then it can only really go ... simple to do, writing thread safe routines is fairly trivial, etc... ...
    (sci.crypt)
  • Re: [ 01/10] [Suspend2] kernel/power/modules.h
    ... On Thursday 02 February 2006 22:48, Pekka J Enberg wrote: ... I would imagine there's only one, ... introduce it whenever you introduce the caller. ... We don't end up with multiple copies of the routine. ...
    (Linux-Kernel)
  • Re: Colbert at Whitehouse correspondents dinner ... THE HORROR!
    ... I can imagine that when some people saw Colbert's routine they stood up ... ti was meant *at* them for the enjoyment of the rest of the country. ... LORELAI: In the movie, only boy hobbits travel to Mount ...
    (rec.arts.tv)
  • Re: If value is in a list
    ... Mike wrote: ... I imagine there's some way to avoid the whole for(i in ... list) routine. ...
    (comp.lang.javascript)
  • Re: Detecting a service that is running
    ... I wrote a routine to determine the state of a given service, but I couldn't imagine that it would be that easy. ... it's not an option for me since I can't guarantee that the WMI service is running. ... This is the problem with multiposting, I posted code in the other thread that would possibly be more useful to you. ...
    (microsoft.public.vb.winapi)