crypto for the average programmer

Richard Levitte - VMS Whacker richard at levitte.org
Mon Dec 19 03:06:48 EST 2005


In message <d4f1333a0512182319s6b56f4c3x374051ff236c5ced at mail.gmail.com> on Mon, 19 Dec 2005 01:19:37 -0600, "Travis H." <solinym at gmail.com> said:

solinym> On 12/19/05, Richard Levitte - VMS Whacker <richard at levitte.org> wrote:
solinym> > C has three really strong points:
solinym> >
solinym> >  - portability.  It's one of the most wide-spread and
solinym> >    portable compiled languages that I know of.
solinym> 
solinym> I beg your pardon?  If I want to store 128 bits of
solinym> information, and access the 8 most significant bits, what
solinym> portable data type would I use? :)

unsigned char foo[8];

(no, it isn't fool proof, but close enough after 1 second of thought).

solinym> The only way C is even remotely portable is with 30 years of
solinym> #include and typedef machinery, and POSIX, and many other
solinym> standards.

You tell me what other language combines the wide spread (which is
important for portability) and speed of C.  Maybe I should have
mentioned availability as well...

solinym> >  - speed.  Most languages with the same level of
solinym> >    portability as C that I know of are interpreted.  They
solinym> >    will probably never get to the level of speed you can
solinym> >    get with C.
solinym> 
solinym> The old joke is that C combines the speed and power of
solinym> assembly language with the portability of assembly language.

Yeah, I've heard it before, and it's a lot of bull, at least the part
about portability.  I'd like to see you run an assembly program for a
68K on a VAX, or a VAX MACRO program on anything else, or...  Oh, and
for fairly modern stuff, try porting assembler between, say, an Alpha
and a Pentium...  Yeah, you probably got it by now.

solinym> Ocaml can outperform C in some cases.  Java is within an
solinym> order of magnitude.

Show me that ocaml is available on all current major platforms, and
I'll start looking at it.  And please, look outside the Unix family
sandbox.  For me, VMS is one of the must-be platforms.

solinym> I mean, technically, the python interpreter is written in C,
solinym> right?  So technically I am using C code when I write a
solinym> python script.  And the C is implemented in assembler, which
solinym> are implemented as microinstructions which are implemented as
solinym> gates.  The point is, pick good expressive primitives, then
solinym> analyze and re-use that low level stuff to write things at a
solinym> higher level.  Minimize the amount you do in an unsafe way.

For some things, I'd agree.  It all depends on what we're talking
about, and from the subject, I'd gather we're mostly talking about
crypto algorithms, which is fairly low level stuff in the security
hierarchy.  I dunno about you, but it seems like most people are a bit
obsessed with speed at that level, like how many AES operations you
can do per second.  Unfortunately, the higher you go, the more complex
your operations become, and if we're talking interpreted languages,
there will always be the cost of interpretation, dispatching into the
underlying C routines, conversion of results, and so on.  I can't see
any way to get around that part.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte                         richard at levitte.org
                                        http://richard.levitte.org/

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
						-- C.S. Lewis

---------------------------------------------------------------------
The Cryptography Mailing List
Unsubscribe by sending "unsubscribe cryptography" to majordomo at metzdowd.com



More information about the cryptography mailing list