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

Re: Photuris // Variable-Precision numbers



Looks like folks have found a new and exciting passtime -- analyzing the
efficiency of bit storage techniques.

The one that I wrote seemed closest to the code at hand.  However, since
there were some questions, which may or may not indicate actual
implementation problems, I have inquired about a couple of packages
which are related to the work at hand:

 1) Gnu Math Package
 2) PKCS
 3) PGP

GMP apparently uses arrays of longs.  Not always the same longs on every
platform.  Using this as our external representation would make truly
large packets, and need more specification.  Not quite what we need.

PKCS uses ASN.1 DER.  I vaguely remember "assinine one" from poking at
SNMP.  It is more compact than the current design for very short
numbers, 12.5% bigger for medium sized numbers, and is lost in the noise
for very large numbers.  It is difficult to parse (masking and shifting
7-bit quantities).  But, since anybody using PKCS or X.509 will have
ASN.1 parsing available, that's how the certificate field will be
defined in those cases.

PGP has a very nice simple representation.  This looks close to what
Karn used in the initial implementation.  I guess that "Implementors"
just pick simpler structures, or maybe it is just that both Karn and
Zimmerman are named Phil, but this looks like they think somewhat alike.

So, I am mangling the PGP representation to allow longer bit strings.
Where simple things such as public-values and hashes are used, this is
the notation:

   Size         two, four, or eight octets. The number of significant
                bits used in the Value field. Always transmitted most
                significant octet first.

                Size zero has no Value field; there are no significant
                bits. This means "missing" or "null", and should not be
                confused with the value zero.

                When the most significant octet is in the range 0
                through 254 (0xfe), the field is two octets. Both octets
                are used to indicate the size of the Value field, which
                ranges from 1 to 65,279 significant bits (in 1 to 8,160
                octets).

                When the most significant octet is 255 (0xff), the field
                is four octets. The remaining three octets are added to
                65,280 to indicate the size of the Value field, which is
                limited to 16,776,959 significant bits (in 2,097,120
                octets).

                When the most significant two octets are 65,535
                (0xffff), the field is eight octets. The remaining six
                octets are added to 16,776,960 to indicate the size of
                the Value field. This is vastly too long for anything in
                these messages, but is included for completeness.

Bill.Simpson@um.cc.umich.edu
          Key fingerprint =  2E 07 23 03 C5 62 70 D3  59 B1 4F 5E 1D C2 C1 A2