Cryptography Library
A couple weeks ago, I started work on a cryptographic library. I plan to use it in another project I have been thinking about for a couple of years, but feel it is past time to make it. I’ll talk about that when it is ready. However, it imposes a number of requirements on the cryptographic library:
- Must work in both a browser and compiled server code
- Client code must not require a webserver
- Elliptic Curve cryptography (secp256k1 curve, same as Bitcoin)
Because of this requirements, I decided to write the code in C++ and compile to both asm.js and to object code (.o) for use in servers.
I’m currently using a bump allocator, but I plan to look at including malloc from from emscripten library or look into another webasm-compatible allocator. I’ve written memory allocators in the past, and I would be very happy if I never had to write another one.
It still has bugs. I am currently debugging an issue with modular multiplication caused in the Newton-Raphson division algorithm it is using.
If you are interested in following the progress, have a look at the git repository stored here on IPFS.