pipe js file to eval? #301
Replies: 6 comments
-
Posted at 2014-07-29 by DrAzzy This may not solve your problem, but doesn't that crypto package you're playing with include minified versions of the files that are a lot smaller? That might make it possible to handle with without piping anything. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-29 by d0773d @drazzy using the minified version of the script didn't give me the out of memory error. However, I am still getting errors:
I'm assuming the crypto package probably won't work on the Espruino. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-29 by d0773d That error was due to me not incorporating the core.js file. So I did:
I am now getting the out of memory error. For a test I commented out the aes file and just loaded the core-min.js. I didn't get the out of memory error when just loading the core-min.js file. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-29 by @gfwilliams For the initial question - no, you can't pipe to eval I'm afraid. Espruino needs to have the whole string of code in memory to execute it. You may find the 'rollups' are a bit more efficient? For instance: http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/aes.js However having looked at it, I think that AES implementation is too big to go in Espruino - not so much the code, but it allocates some arrays, and I think those fill up the available memory. With a bit of tweaking and changing to Int32Arrays you might be able to fit it in though. You could always use MD5, which seems to be a bit more efficient: http://crypto-js.googlecode.com/svn/tags/3.0.2/build/rollups/md5.js You can actually copy the contents of the rollup, paste it into the Web IDE and do:
But having said that, the answer gained from the MD5 library on Espruino doesn't match what I get from a desktop JS implementation. I'll try and find out why, but I'm not sure when I'll have time, so if anyone is able to track down which operation in Espruino isn't working as expected it'd be hugely helpful! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-29 by @gfwilliams I've just fixed a bug that stopped the MD5 implementation here from working on the Espruino board - that'll be in 1v68: http://pajhome.org.uk/crypt/md5/md5.html the cryptojs MD5 still isn't working though... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-29 by d0773d @gordon, Thank you for taking the time to assist me. Encryption by using the Espruino isn't a necessity. At the moment, I am looking for a wifi module that has hardware encryption. As far as the Lantronix xPico wifi module that I boasted about a few weeks ago, well, it turns out I was wrong about the built in encryption. I was reading the wrong product info LOL :/ It turns out the Lantronix xPico ethernet module supposedly supports AES encryption. So, now I am in the market to purchase another wifi module that supports AES encryption. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-07-29 by d0773d
I am trying to pipe my aes.js file to eval because the file is too large. My code:
I get error:
Beta Was this translation helpful? Give feedback.
All reactions