Issues with getting fastecdsa working in WindowsSee original GitHub issue
There are some issues getting the module working in Windows - I found fixes, but they aren’t very elegant:
Microsoft Visual C++ Compiler for Python 2.7package doesn’t seem to support C99 style variables, so I had to move all variable declarations to the start of functions.
- Don’t bother trying to get GMP working on Windows, just use MPIR instead.
- If the MPIR library is compiled against a different runtime than fastecdsa (I used VS2015 for compiling MPIR and the previously mentioned VCC for Python 2.7 on fastecdsa), it will mysteriously crash after
free()ing the buffer returned from
mpz_get_str()- seems to be because memory allocators in different VC runtimes are sometimes incompatible. Changing the
__gmp_default_freefixed this issue.
- Created 6 years ago
- Comments:27 (7 by maintainers)
Top GitHub Comments
You need to have an microsoft visual 2019 and Microsoft c++ in visual studio to run the fastedcsa. You cannot install it without Microsoft c++. after that follow this instruction.
- Download https://github.com/ChillMagic/MPIR-Binary
- Download https://github.com/AntonKueltz/fastecdsa
- rename mpir.h to gmp.h from MPIR-Binary-master\include and rename mpir.lib to gmp.lib from MPIR-Binary-master\lib\MD\x64\Release
- Copy and paste gmp.lib C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.21.27702\lib\x64
- Copy and paste gmp.h C:\Phyton3\include
- I don’t remember if I do this ( just put mpir.dll from MPIR-Binary-master\dll\x64\Release in to the directory of package, C:\Python37\Lib\site-packages\fastecdsa ) Do it last if you have error. if not working try to rename it again to gmp.dll But I guess it’s not needed to install fastedcsa.
- Open CMD and cd to where you put your fastecdsa E:\Download\fastecdsa-master
- when your cmd is in the directory type: python setup.py build
- after installation type again: python setup.py install
- Good Luck treasure hunting.
Here is somthing interesting - I have not directory of package, .\Lib\site-packages\fastecdsa just egg file in .\Lib\site-packages Different python build/install systems? How to check it? Also, no mpir.dll at my machine at all. Have mpir.lib at MPIR build dir copyed to VC\lib\gmp.lib Attached file is build log from scratch. But, from working machine, were exist working fastecdsa pack build.log
You can just copy
fastecdsa from egg directory to
site-packages. Also I dont know about python 2.7. I’ve tested on 3+ only. My steps were:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
mpir.lib to package directory, it could be