The PartSize field contains the entire part, that is data + nexthash. This
is because the PartSize is generic and means "bytes between control
byte". So for CHK you should be reading PartSize-20 bytes of data, 20
bytes of hash, then one Control Byte.

Internally the ProgressiveHashInputStream reads partsize as distance to
hash (yeah, I know, I suck) which is why it worked there.

Sorry to fuck it up for you, I thought I had told you this.

On Thu, Aug 17, 2000 at 01:10:32PM +0000, Adam Langley wrote:
> Just testing with Whiterose with CVS about 1/2 hour old
> 
> java Freenet.client.BInsert -serverAddress tcp/127.0.0.1:21773 -htl 1 
> freenet:CHK@ ~/1984.html
> 
> now wrose reads all this in fine untill it comes to the control byte, which is
> neither 0x00 or 0x01. There is, however, 0x00 (CB_OK) after the data part. As
> I understand it (and as is documented) the control byte should be after the
> hash, not before.
> 
> Just to clear things up: (P = part 16384 bytes long, H = SHA1 hash, C = CB_OK)
> I'm expecting PHC
> I'm getting PCH
> 
> However when I test:
> java Freenet.crypt.ProgressiveHashInputStream ~/1984.html 16384 1
> 
> I get the expected PHC order. Attached is a raw dump of the bad data from
> BInsert, it stops just after the first part because wrose aborted. Note the 
> CB_OK at offset 0x4000 - I think it should be at 0x4014.
> 
> AGL
> 
> -- 
> Whenever anyone says, "theoretically," they really mean, "not really."



-- 
\oskar

_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to