-
Notifications
You must be signed in to change notification settings - Fork 25
Closed
Description
I was able to successfully install wolfcrypt on Ubuntu (WSL) with pip install wolfcrypt, but I am getting following error when I try installing it on Windows.
I built the source distribution with python setup.py sdist which cloned and built wolfssl in lib\wolfssl directory. Then I get following error output when I try installing it with pip:
running build_ext
generating cffi module 'build\\temp.win-amd64-cpython-310\\Release\\wolfcrypt._ffi.c'
creating build\temp.win-amd64-cpython-310\Release
building 'wolfcrypt._ffi' extension
creating build\temp.win-amd64-cpython-310\Release\build\temp.win-amd64-cpython-310\Release
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\benja\AppData\Local\Temp\pip-install-8w7o9_v5\wolfcrypt_571d3b51d3bb43489b34dabc4d0558fd\lib\wolfssl\win-amd64\v5.8.2-stable\include -IC:\Users\benja\AppData\Local\Temp\pip-install-8w7o9_v5\wolfcrypt_571d3b51d3bb43489b34dabc4d0558fd\lib\wolfssl\build "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\include" "-IC:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\Include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.26100.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.26100.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcbuild\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c /Fobuild\temp.win-amd64-cpython-310\Release\build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.obj
wolfcrypt._ffi.c
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1350): error C2143: syntax error: missing ')' before '*'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1350): error C2143: syntax error: missing '{' before '*'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1350): error C2059: syntax error: ')'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1350): error C2054: expected '(' to follow 'p'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1355): error C2061: syntax error: identifier 'KyberKey'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1355): error C2059: syntax error: '}'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1387): error C2079: 'y' uses undefined struct 'dilithium_key'
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1672): error C2065: 'WC_ML_DSA_44': undeclared identifier
build\temp.win-amd64-cpython-310\Release\wolfcrypt._ffi.c(1673): error C2065: 'WC_ML_DSA_44': undeclared identifier
Seems like there are some macro conflicts that is causing syntax error and cascade into other errors. Following is the automatically generated user_settings.h that was in the build directory.
#ifndef _NON_FIPS_USER_SETTINGS_H_
#define _NON_FIPS_USER_SETTINGS_H_
#ifndef _WIN32
#error This user_settings.h header is only designed for Windows
#endif
#define WOLFCRYPT_ONLY
#define WOLFSSL_AESGCM_STREAM
#define HAVE_AESGCM
#define GCM_TABLE_4BIT
#define WOLFSSL_AES_COUNTER
#define WOLFSSL_AES_OFB
#define HAVE_CHACHA
#define HAVE_POLY1305
#define WOLFSSL_SHA384
#define WOLFSSL_SHA512
#define WOLFSSL_SHA3
#define WOLFSSL_SHA224
#define WOLFSSL_NO_SHAKE256
#define NO_MD5
#define HAVE_HKDF
#define NO_OLD_TLS
#define WC_RSA_PSS
#define WOLFSSL_PSS_LONG_SALT
#define HAVE_ECC
#define WOLFSSL_VALIDATE_ECC_KEYGEN
#define WOLFSSL_ECDSA_SET_K
#define ECC_USER_CURVES
#define HAVE_ECC192
#define HAVE_ECC224
#define HAVE_ECC256
#define HAVE_ECC384
#define HAVE_ECC521
#define HAVE_ED25519
#define HAVE_CURVE25519
#define WOLFSSL_KEY_GEN
#define NO_OLD_RNGNAME
#define NO_OLD_WC_NAMES
#define NO_OLD_SSL_NAMES
#define NO_OLD_SHA_NAMES
#define NO_OLD_MD5_NAME
#define NO_ERROR_STRINGS
#define WOLFSSL_PUBLIC_MP
#define FP_MAX_BITS 16384
#define WC_RSA_BLINDING
#define ECC_TIMING_RESISTANT
/* PKCS7 requirements */
#define HAVE_PKCS7
#define HAVE_AES_KEYWRAP
#define WOLFSSL_AES_DIRECT
#define HAVE_X963_KDF
#endif /* _NON_FIPS_USER_SETTINGS_H_ */
Please let me know if there any solution!
Metadata
Metadata
Assignees
Labels
No labels