BlockchainCommons / BlockchainCommons/bc-sskr
Compiling C code to WebAssembly
- Dominant language
- C
- Stars
- 22
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
We would like to add SSKR to [AirGap Vault](https://github.com/airgap-it/airgap-vault). We currently use our own custom SSS, which we would like to phase out in favor of this standard.
Because I'm not a cryptographer and following the rule of "not rolling your own crypto", I don't feel comfortable porting this library to javascript/typescript myself.
Compiling the C code to WASM might be a good solution. For our project, we did compile some Rust code to WASM, which works well. I have never worked with C before, but I would like to give it a try and create a proof of concept.
Have you already considered compiling the code to WASM and releasing it to npm?
---
I also have a beginner question for C projects. I tried getting both this library and `lifehash` running on my computer, but both projects failed to build.
I'm using VS Code and Docker, with the following image:
https://github.com/microsoft/vscode-dev-containers/blob/v0.155.1/containers/cpp/.devcontainer/base.Dockerfile
https://github.com/microsoft/vscode-dev-containers/tree/v0.155.1/containers/cpp
For this repository, the configure step fails with `### Error! libbc-crypto-base must be installed first.`. The readme says that this is expected, but how do I install and link it? Is there an easy way to do it or do I have to clone/build it manually?
The lifehash issue is more generic and might be related to my setup, but I did try it in an Ubuntu VM to rule out docker issues as well with the same result:
```
vscode ➜ /workspaces/bc-lifehash (master ✗) $ make
cd src && make all
make[1]: Entering directory '/workspaces/bc-lifehash/src'
libtool -static -o liblifehash.a bit-aggregator.o bit-enumerator.o cell-grid.o color.o color-func.o color-grid.o format-utils.o gradients.o hsb-color.o lifehash.o memzero.o patterns.o point.o sha256.o
Usage: /usr/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool: error: unrecognised option: '-static'
make[1]: *** [Makefile:95: liblifehash.a] Error 1
make[1]: Leaving directory '/workspaces/bc-lifehash/src'
make: *** [Makefile:16: all] Error 2
```
I googled for over an hour, but practically all errors were related to the wrong `libtool` version being installed or the executable being in the wrong path. But neither seem to be the case here:
```
vscode ➜ /workspaces/bc-lifehash (master ✗) $ libtool
[...]
host-triplet: x86_64-pc-linux-gnu
shell: /bin/bash
compiler: gcc
compiler flags: -g -O2 -fdebug-prefix-map=/build/libtool-2.4.6=. -fstack-protector-strong -Wformat -Werror=format-security
linker: /usr/bin/ld -m elf_x86_64 (gnu? yes)
version: libtool (GNU libtool) 2.4.6 Debian-2.4.6-14
automake: automake (GNU automake) 1.16.1
autoconf: autoconf (GNU Autoconf) 2.69
```
Any help would be apprechiated.
Contributor guide
Assessment
This issue has not been assessed yet.