[tahoe-lafs-trac-stream] [Tahoe-LAFS] #266: when pycryptopp has random-access AES, update helper to use it

Tahoe-LAFS trac at tahoe-lafs.org
Sun Aug 16 15:26:37 UTC 2015


#266: when pycryptopp has random-access AES, update helper to use it
-------------------------+-------------------------------------------------
     Reporter:  warner   |      Owner:  warner
         Type:           |     Status:  new
  enhancement            |  Milestone:  eventually
     Priority:  minor    |    Version:  0.7.0
    Component:  code-    |   Keywords:  upload-helper pycryptopp
  encoding               |  performance random-access
   Resolution:           |
Launchpad Bug:           |
-------------------------+-------------------------------------------------
Changes (by zooko):

 * keywords:  helper pycryptopp performance random-access => upload-helper
     pycryptopp performance random-access


Old description:

> to build the offloaded-uploader (#116), we need the ability to do AES CTR
> mode at arbitrary places in the input stream. I think a second (optional)
> argument to {{{aes.AES.process()}}} that accepts a byte offset would do
> the
> trick. I'm imagining something like:
>
> {{{
>    def process(self, data, offset=None):
>        if offset is None:
>            offset = self._last_offset
>        block = aes_encrypt(self._key, number_as_string(offset))
>        output = xor(data, block)
>        self._last_offset = offset + len(data)
>        return output
> }}}
>
> (with all the appropriate joy of handling block boundaries, of course)

New description:

 to build the offloaded-uploader (#116), we need the ability to do AES CTR
 mode at arbitrary places in the input stream. I think a second (optional)
 argument to {{{aes.AES.process()}}} that accepts a byte offset would do
 the
 trick. I'm imagining something like:

 {{{
    def process(self, data, offset=None):
        if offset is None:
            offset = self._last_offset
        block = aes_encrypt(self._key, number_as_string(offset))
        output = xor(data, block)
        self._last_offset = offset + len(data)
        return output
 }}}

 (with all the appropriate joy of handling block boundaries, of course)

--

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/266#comment:12>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list