[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bignums



I believe the real issue is which format is used by various crypto 
libraries, where bignums will be used.  I can think of RSAREF, BSAFE and 
crypto++.  When I fill in a public key for one of these libraries to use, I 
would like to use memcpy rather than a byte-reversing for() loop.

BSAFE, at least, takes most significant byte first (in lowest address).
I assume RSAREF does as well.
I haven't looked inside crypto++ for this.

I grant that it is more efficient to have the least significant byte in the 
least address.  I suspect that these libraries actually swap bytes 
internally.  However, we are presented with a programmer's interface, at 
least for BSAFE, in which the most significant byte is first.  If we encode 
bignums as least significant byte first, then we are forced to byte-swap
whenever we use them.

 - Carl



+------------------------------------------------------------------+
|Carl M. Ellison  cme@cybercash.com   http://www.clark.net/pub/cme |
|CyberCash, Inc.                      http://www.cybercash.com/    |
|207 Grindall Street   PGP 2.6.2: 61E2DE7FCB9D7984E9C8048BA63221A2 |
|Baltimore MD 21230-4103  T:(410) 727-4288  F:(410)727-4293        |
+------------------------------------------------------------------+


Follow-Ups: References: