On Feb 18, 2012, at 8:16 PM, [email protected] wrote:

> Hello Fabio,
> 
> Clipperz's implementation does not use typed array, as they are too
> new and too little supported for our target.
> 
> But Clipperz is wrapping all the binary data manipulation into an
> abstract BinaryArray class [1]. This abstract class had a few
> different implementations, one using untyped arrays, another using
> regular strings and a third one using hex strings. The hex string
> implementation performed very badly, and also the string one was not
> working great, so at the moment only the array based implementation is
> left.
> 

Yeah a custom BinaryArray class i generally the way to do it. Also sjcl the
stanford crypto library does that.

https://github.com/bitwiseshiftleft/sjcl/blob/master/core/bitArray.js

> But it would be trivial to add another implementation based on typed
> arrays; and it would also be possible to have both implementations
> available, and selecting the right one based on the browser where the
> code is going to be executed.
> 

It may be a good idea to have a default that goes for typed arrays and fails
over to a generally compliant version.

I would consider the fact for Clipperz to use already existing open source 
javascript
libraries for handling the crypto. It's bad to reinvent the wheel.

SJCL is very widely used and academically studies it might be a good idea to
switch to that.

- Art.

> 
> 
> On Sat, Feb 18, 2012 at 6:23 PM, Fabio Pietrosanti (naif)
> <[email protected]> wrote:
>> Venom told me about the typed array to manipulate efficiently (on
>> latests browsers) raw binary data:
>> 
>> http://caniuse.com/#search=typed%20array
>> 
>> Does OpenPGPJS or clipperz or pgpbox use such techniques?
>> 
>> -naif

_______________________________________________

http://openpgpjs.org

Reply via email to