Re: Streaming - [Re: CryptoOperation and its life cycle]

Sent from my iPhone

On Dec 14, 2012, at 6:00 AM, "Wan-Teh Chang" <wtc@google.com> wrote:

> On Fri, Dec 14, 2012 at 3:29 AM, Aymeric Vitte <vitteaymeric@gmail.com> wrote:
>> 
>> I am not talking about a partial hash output.
>> 
>> To be clear, the question is how to do what is here
>> https://github.com/Ayms/node-Tor/blob/master/src/crypto.cc#l396-416 ( what
>> is commented was the initial behavior, ie close the hash after digest, I did
>> modify it to keep the state before digest and process it again after digest)
>> or here https://gitweb.torproject.org/tor.git/blob/HEAD:/src/common/crypto.c
>> (lines 1578-1587, same thing)
> 
> What Aymeric Vitte requested is the ability to fork a digest operation
> so that we can finish one branch of the fork to obtain the digest of
> the data up to that point.
> 
> This is used in the CertificateVerify handshake message of the SSL/TLS
> protocol, so most native crypto libraries have this function. This
> issue was discussed before. Digest is the only operation I know of
> that has uses cases for this fork/copy/clone feature.

I can see why something additional is needed to do this with actual streams - but we don't have those yet in the API.

With simple ArrayBuffers, what's the problem with calculating separately the digest over A and A|B ? ( | = concatenation). Is it just to optimize so that we don't do the work for A twice ?

...Mark
> 
> Wan-Teh
> 
> 

Received on Friday, 14 December 2012 14:31:55 UTC