potatosalad / erlang-libdecaf

ed448goldilocks (libdecaf) NIF with timeslice reductions for Erlang and Elixir.
MIT License
29 stars 16 forks source link

Problem compiling #1

Closed cs-victor-nascimento closed 8 years ago

cs-victor-nascimento commented 8 years ago

Hey @potatosalad! I was trying to test autodiscovery of libdecaf in JOSE (with Joken) but I can't compile.

I get this error:

/home/victornascimento/dev/elixir/joken/deps/libdecaf/c_src/libdecaf_nif.h:152:2: error: unknown type name ‘uint8_t’
  uint8_t   version;

I am on Ubuntu 15.10 64 bits. If you need more info I will gladly fetch it.

Thanks!

potatosalad commented 8 years ago

Hey @cs-victor-nascimento!

The main libdecaf library is still being finalized and made more portable (right now I've only tested it on OS X and SmartOS). An "almost final" version of the EdDSA draft was released yesterday, so the EdDSA functions in libdecaf will probably be finalized soon and it will actually be released. Mike Hamburg is the author of the library, so I'm not sure about an exact release date.

That said, the uint8_t error is probably just due to a missing #include <stdint.h> in the c_src/libdecaf_nif.h file. I'll see if I can sync the latest changes from libdecaf and get that added, too.

cs-victor-nascimento commented 8 years ago

Thanks for clarifying! I tested libsodium and it worked great. I was wondering how faster this was going to be.

Do you think it is best to let this issue open?

potatosalad commented 8 years ago

@cs-victor-nascimento I just published version 0.0.2 to hex.pm and I finally got the builds passing on travis with clang 3.7.

On Linux, you may need gcc >= 4.7, g++ >= 4.7, and/or clang >= 3.6 for this to build properly. If you're still having problems, try building with environment variables like CC=gcc-4.7 CXX=g++-4.7 ARCHFLAGS= prefixing mix or make or however you're installing this.

Let me know if that works and we'll close this issue.

cs-victor-nascimento commented 8 years ago

Nice! Just checked it and it works perfectly. The boost in speed is also unbelievable though expected.

Looking forward to your work on libsodium for implementing timeslice reductions in those NIFs too!

Thanks once again!