﻿id	summary	reporter	owner	description	type	status	priority	milestone	version	resolution	keywords	cc	launchpad_bug
18	AES-CTR: easy way to modify the counter for random-access decryption	warner		"I'd like to improve Tahoe's download process to allow random-access decryption. To do this, I need to be able to tell the AES decryptor object to process data from arbitrary points in the keystream.

I think it's possible to do this with the current API, by creating a new AES instance every time the counter jumps, and passing it an {{{iv=}}} argument which is a string into which we've packed the current offset. But this is too hard, and the {{{iv=}}} argument accepts arbitrary-length strings, making it difficult to confirm that we're supposed to pass in a string whose length is the same as the AES block size.

I'd like to have an extra argument to {{{process()}}}, which will reset the counter value. This argument should take a positive number (an int or long). If this argument is not provided, the counter should use the normal self-incrementing value. So:

{{{
 a = AES(key)
 data1 = AES.process(""abcde"")
 data2 = AES.process(""fghij"")
 data3 = AES.process(""klmno"")
}}}

should produce the same ""data1"", ""data2"", and ""data3"" as:

{{{
 a = AES(key)
 data2 = AES.process(""fghij"", counter=5)
 data3 = AES.process(""klmno"")
 data1 = AES.process(""abcde"", counter=0)
}}}
"	enhancement	new	major	0.7.0	0.5.1		review-needed		
