TypedArray doesn't go through Dart -> JS smoothly. It has to be converted to a JS standard Array to get through.  

Then base64 encoding sounded reasonable to me.

To get NaCL to work from Dart, I have to go through Dart code -> JS code -> NaCL -> JS code -> Dart code.

Dart HTML APIs don't allow to communicate to NaCL modules directly.  

--  
Hoa V. Dinh


On Sunday, April 6, 2014 at 9:05 AM, John McCutchan wrote:

> In ide/nacl_android_rsa/instance.cc:
> > + // Returns the exported private key. > + postResult(uuid, exported); > +} > + > +void AndroidRSAInstance::sign(Var& uuid, VarArray& parameters) { > + if (parameters.GetLength() != 2) { > + postErrorInvalidNumberOfParameters(uuid); > + return; > + } > + // First parameter is the private key. > + Var key_to_import = parameters.Get(0); > + if (!key_to_import.is_string()) { > + postErrorInvalidTypeOfParameters(uuid); > + return; > + } > + // Second parameter is the base64 encoded message to sign.  
> Why not use a TypedArray and save the base64 encode/decode/encode/decode.
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/dart-lang/spark/pull/1478/files#r11326807).
>  
>  
>