-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript rewrite #14
base: master
Are you sure you want to change the base?
Conversation
Sounds great, will be following progress :) Let me know if you need any help |
Thanks. Just pushed up another commit. Trying to remove all your minified files, your globals, and start using Can you help me figure out the types of everything, and replace all globals with parameters? E.g.: your BigInteger library, is that something custom you've built? - Could we switch to the popular https://github.com/peterolson/BigInteger.js ? |
Yeah sure, where'd you like to start? I think the bigInteger library in use is jsbn. As far as I can remember its only used in key exchange ( Diffie Hellman ) to do the |
Hacked together a quick benchmark and it'll be a massive performance degradation to move libraries. JSBN is shipped as two parts (minimal & additional) and was manually stitched together to include the necessary functions.
jsbn =~ 150ms |
Thanks for that, okay I've switched to my fork which incorporates the two relevant open PRs. Been thinking of replacing:
With
Also trying to figure out:
But yeah, if you can take a quick look through the code, I'm sure 5 minutes with you would mean many times that for me. Thanks |
1 - 2 - 3 -
4 - Can't remember where I found
5 - Yeah when the client is created the Had a brief scan over most recent commit and think that the |
Oh, I meant that Same as
To:
Anyway, I think I've gone about as far as I'm comfortable going. TBH would prefer moving the actual crypto code—HMAC, SHA1, SHA256, MD5—to someone else's library, such as sjcl (which is already being used). Maybe keep the MD5 code After that, was thinking to integrate webpack, and bifurcate SSHy into SSHy-lib and SSHy-client, so that the lib version can be used in other frontends, ensuring that all globals are removed in the process. |
Great work so far :) Decryption is a bit weird; cause there wasn't a reliable way to disable nagle and the code being event based, the data gets added to a buffer here which is interacted with by I might look at replacing some of the crypto stuff with WebCrypto API as it should be a significant improvement over JS. I like the idea of splitting it up too |
@stuicey Thanks, yeah I think this is where I leave it in your hands (for a time). Lots of types still need to be annotated, but the bulk of the work has been done. Once you have it compiling with TypeScript, I'll finish integrating WebPack and expose a neater interface (such that it is usable without expecting HTML elements to be on the page, and allows for explicit reference of them by name (so you can have multiple on the one page), and also exposes a decoupled library for use in frameworks (like Angular, Vue and React). |
Begun the rewrite 🐳
Importantly this will enable:
Still TODO on the reimplementation side:
var
withconst
andlet
<div>