Re: 8-bit modular exponentiation code?

2003-05-31 Thread Major Variola (ret)
At 07:30 AM 5/24/03 +0100, Adam Back wrote:
Colin Plumb's crypto library bnlib supports multiple word size I
believe.
On Fri, May 23, 2003 at 11:36:58AM -0700, Major Variola (ret.) wrote:
 Anyone know of any open-source modexp code for 8-bit cpus?

Thank you for your response, however (for the record) that code requires

at least a 16bit CPU.  From bnlib.doc (an amusing read, BTW):

It is written in C, and should compile on any platform with an ANSI C
compiler and 16 and 32-bit unsigned data types

Small is defined as less than 65536, the minimum 16-bit word size
supported by the library.



Re: 8-bit modular exponentiation code?

2003-05-31 Thread Mike Rosing
On Fri, 30 May 2003, Major Variola (ret) wrote:

 On Fri, May 23, 2003 at 11:36:58AM -0700, Major Variola (ret.) wrote:
  Anyone know of any open-source modexp code for 8-bit cpus?

 Thank you for your response, however (for the record) that code requires

 at least a 16bit CPU.  From bnlib.doc (an amusing read, BTW):

 It is written in C, and should compile on any platform with an ANSI C
 compiler and 16 and 32-bit unsigned data types

 Small is defined as less than 65536, the minimum 16-bit word size
 supported by the library.

It can't be that hard to modify it to work with an 8 bitter.  I've
written an aweful lot of 40 bit floating point routines for everything
from 6809's to PIC's.  8 bit modulus code should be easy.

Patience, persistence, truth,
Dr. mike



Re: 8-bit modular exponentiation code?

2003-05-31 Thread Major Variola (ret)
At 10:34 AM 5/30/03 -0700, Bill Frantz wrote:

I think your best bet for an 8 bit CPU will be an assembly language
routine.

Likely so.  For those interested, I found this article,
which does in fact use enhanced (it has a multiplier)
Z80 assembly, included in the article:

http://www.ddj.com/documents/s=1030/ddj9309e/9309e.htm
The Z80180 and Big-number Arithmetic
Squeezing 512-bit operations out of 8-bit microcontrollers
Burton S. Kaliski, Jr.

For instance, in one recent project, our challenge was to implement
512-bit RSA
private-key operations in less than 10 seconds on Zilog's 8-bit Z80180
microcontroller running at 10
million cycles/second.

.

The folks at cyphercalc.com have a cyphermath8 library, albeit
commercial.
See http://cyphercalc.com/math/features.htm
They give this performance data for the Rabbit CPU (see
http://cyphercalc.com/math/performance.htm)

780 milliseconds for a modular exponentiation with a 128-bit base,
40-bit exponent,
and 128-bit odd modulus. Exponent ones density: 50%. Target: Rabbit
Semiconductor RCM2020, running at 18.4Mhz. Compiled under Dynamic C,
version
6.03, with assembly optimizations in effect.

[no affiliation]

.
Smartcard vendors tend to include a modexp co-processor.