-
Notifications
You must be signed in to change notification settings - Fork 127
[wip] Add libsodium #83
base: master
Are you sure you want to change the base?
Conversation
I'm working (based on this PR) on creating JS bindings for libsodium. Should I create methods that provide ease-of-use interfaces to the functions, or just functions that are raw interfaces? Like |
I think easy-you-use functions, to prevent possible incorrect usage. |
I would do the easy-to-use functions in Javascript, that internaly use low-level C++ bindings. I think is the most clean and flexible scheme. |
@facekapow @piranna what do you guys think about the idea to implement |
Between a w3c spec or the Node.js API I will alwahs advocate for the first
|
@piranna yeah, I think generally it would be pretty nice to be compatible with the browser/web platform. Also things like w3c streams spec https://streams.spec.whatwg.org/, web workers spec, fetch api etc. |
I think that maintaining compatability with the Broswer should always be more important. But, to work with both APIs, we could have one internal API that covers both and 2 external APIs, one for Node, and one for the browser, which would use the internal API. |
Not a bad idea... a low level, thin wrapper layer on top of OpenSSL, and
|
I need help. I can't figure out what I did to screw up |
@facekapow ok, I'll look into it |
Same thing with |
Well, I forgot to squash the commits 😦 |
@iefserge Could you enable squash merging on the repo, for when this is merged? (I'm pretty sure having all those commits as part of the git history isn't such a good idea, sorry) |
@facekapow yeah, let's squash them. Diff is pretty crazy here, merge libsodium files separately first? I guess it should make it easier to work with the PR. Not sure how hard it would be to split it though, I can look into it if you'd like. |
Sure, right now I'm trying to figure out what's the problem with having keys as Uint8Arrays, because none of the decryption functions work. I'm going to revert back to keys as strings locally and try that out. |
@facekapow ok, I'm going to merge this commit 25d6bcb (I guess I should've done that earlier), it will create a conflict with this branch, after that you should be able to do something like
sounds good or maybe there is an easier way?:) |
Sounds great, I certainly don't know a better way. |
@iefserge There, history has been fixed, and the conflicts are resolved. 😃 |
This PR adds statically linked libsodium. This is not very nice compared to using a js version, but this should load and compute faster. JS version also slows down browserify builds. Eventually this could be replaced by the WASM compiled module and loader that doesn't require using browserify.