stef / libopaque

c implementation of the OPAQUE protocol with bindings for python, php, ruby, lua, zig, java, erlang, golang, js and SASL.
GNU Lesser General Public License v3.0
69 stars 10 forks source link

Error when run "make" command #24

Closed sofiawong closed 2 years ago

sofiawong commented 2 years ago

image

Hi, I face this issue. I appreciate if anyone can help me resolve. I have already install opaque using pip but it raises an error that they could not find libsodium which explains why I following additional installation instructions in libopaque repo! Thank you!

stef commented 2 years ago

you need to download and unpack latest libsodium-*-mingw.tar.gz and unpack it. 'https://download.libsodium.org/libsodium/releases/' and then set -I to where the includes are and -L to where the dlls are.

sofiawong commented 2 years ago

Hi, thanks for the reply. May I know what is the command for -l and -L? @stef

sofiawong commented 2 years ago

image I have already installed libsodium. It resides in /usr/include and I make a symbolic link ln -s /usr/include/sodium.h sodium.h to libopaque/src directory

but it is still not working as it mentions "common.h:5:10: fatal error: sodium.h: No such file or directory"

stef commented 2 years ago

i'm confused. in your screenshot it says your CC is mingw, and then you say you have sodium.h already in /usr/include. for what arch are you trying to compile?

stef commented 2 years ago

anyway i updated the makefile, if you drop mingw64 sodium into win/libsodium-win64 then make mingw64 should work for your. see the commit https://github.com/stef/libopaque/commit/39b6a00c6f0098cc7d1c5b29f0fe8a1bf7429f7f

sofiawong commented 2 years ago

@stef , "sodium.h" not found is solved but another error popped up.

image

stef commented 2 years ago

you don't really need the munit tests, do you?

sofiawong commented 2 years ago

Yea, I wanted to ignore it. But, they still can't find this library which I already pip installed it. @stef

image

stef commented 2 years ago

on what operating system are you? why are you using mingw?

sofiawong commented 2 years ago

I running my code in python docker which is linux. @stef The lib complained they couldnt find mingw so I had to install it

stef commented 2 years ago

then why do you use mingw as a compiler suite?

stef commented 2 years ago

mingw compiles for windows

sofiawong commented 2 years ago

the error said they couldnt find mingw, so I installed it. @stef

stef commented 2 years ago

oooooooh. i just committed a fixed makefile where mingw is not the default target. you don't need mingw. and i hope with this fixed makefile you have no troubles anymore.

sofiawong commented 2 years ago

@stef , thanks for the fix.

I have no issues running make command but the python opaque library still isnt found.

image

stef commented 2 years ago

maybe you need to ldconfig?

stef commented 2 years ago

also did you do make install? i recommend

sudo PREFIX=/usr make  install
sudo ldconfig
sofiawong commented 2 years ago

@stef , in addition, I had to install pysodium. Thanks for the help. Have a good week ahead!

sofiawong commented 2 years ago

@stef , sorry to bother again. May I know what is the encoding used for the byte string for python? So I can decode properly and return as a string As I am using graphql, it does not support robust output return. image

stef commented 2 years ago

it's just binary bytes. i recommend just base64-ing them.