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

6-bit coding (correction)




Correction: 

	The rule should say: if either parenthesis is in a 6-bit region,
	then check to see that they are in the SAME 6-bit region by
	comparing their counts.  

Example: the input 
	( #1:{AA} )
should pass, even though the parens are in different regions.

Ron Rivest

==============================================================================
Date: Wed, 16 Apr 97 22:36:30 EDT
To: cme@cybercash.com
Cc: angelos@dsl.cis.upenn.edu, ylo@ssh.fi, spki@c2.net
Subject: 6-bit coding

Carl --

I like your idea of restricting the 6-bit to handle only balanced
S-expressions underneath.  Here is a simple way to handle this that I
thought of:

* Keep a running count of how many "mode-switches" there have been
  (e.g. 8-bit to 6-bit, or vice versa). Each region of input can be
  identified with the corresponding count.

* When parsing a list, note the count at the time you scan the 
  "(", and also when you scan the ")".  Compare these and check
  that they are the same.

This is sufficient to avoid having funny parenthesizations
happening inside a base-64 blob that you don't see.

You could extend this to check the first and last character of tokens
or raw strings, but I don't think that is necessary, and may be
even undesirable...

Does this work for you?

Cheers,
	Ron


Follow-Ups: