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

Re: Canonical form for signing S-expressions



-----BEGIN PGP SIGNED MESSAGE-----

At 07:36 PM 4/14/97 +0200, Alan Barrett wrote:
>	(a b (cd e fgh)) 
>	(1:a,1:b,(2:cd,1:e,3:fgh))
>
>For on-the-wire encoding, there might be some advantage to pre-declaring
>the length of each parenthesised group (in the hopes of making memory
>allocation easier), something like this: 
>
>	(a b (cd e fgh)) 
>	30:(1:a,1:b,16:(2:cd,1:e,3:fgh),),

I believe it's very important that if we were to use lengths for lists, they 
should be number of items, not number of bytes:

1) you know # of items without walking all the way down, but don't know 
length without that walk

2) memory allocation (of an array of pointers) depends on # of elements, not 
# of bytes

However, it's cheaper to transmit lists without lengths and that form
looks like it's winning.

 - Carl

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBM1Z3J1QXJENzYr45AQGVGQP9GU3iJUfySf9JYzQv0BDw9HzTZAzf6FhM
/x0gUqk+XqVUiaRX3FSIXYbjewPBiLIl1d1IXjgfIpD09FNK+2lxyj6Bgv3W3ydI
XKRt3ypJYTWlk4k8tJZ1RazmLMtcszJjAVgjPwwWr/KIIS6ln/ke2F4B3XPd0XqP
NrRWr+kR5y4=
=wNq5
-----END PGP SIGNATURE-----


+------------------------------------------------------------------+
|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        |
+------------------------------------------------------------------+


References: