Giter Club home page Giter Club logo

py-cryptonight's Introduction

Python CryptoNight implementation

Build Status

Python binding for Monero hash functions cn_fast_hash, cn_slow_hash.

  • cn_fast_hash is used mainly for hashing to scalars / EC points.
  • cn_slow_hash is CryptoNight hash function used for mining and encryption key derivation for encrypted wallet files.
    • Supports CNv1, CNv2, CNv4
    • JIT tested on OSX + LLVM, experimental

Py2, Py3 compatible + tests with Monero test vectors.

pip install py-cryptonight

Usage

import binascii
import pycryptonight

pycryptonight.cn_fast_hash(b'1')
# hexcoded: b'c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6

pycryptonight.cn_slow_hash(b'1')
# hexcoded: b'cbdfba46388e040422b4a9daa471726be659ae184ee86420c2795647f0b301d5

# variant 1:
pycryptonight.cn_slow_hash(binascii.unhexlify(b'38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb'), 1)  # variant 1
# hexcoded: b'ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b

# variant 2:
pycryptonight.cn_slow_hash(b'1', 2)  # variant 2
# hexcoded: b'44016d2376838d89b374e99a20118c0e8916e8c0a5b910744efc7d8f426509ca

# variant 4:
pycryptonight.cn_slow_hash(b'1', 4)  # variant 4
# hexcoded: b'97db7e03629f7c17e4d78b36a2d247d226b88a8df6cf69f2e4cdae1f1b706b4a

# variant 4, height:
pycryptonight.cn_slow_hash(b'1', 4, prehashed=0, height=1)  # variant 4, height 1
# hexcoded: b'09bcf4997132dc3d7980125620724acc9c90dc393cb6694097a7d745c57b6b5b

Build problems

The extension builds with AES extension by default. To disable this, rebuild with:

MONERO_NO_AES=1 python setup.py install

JIT

The JIT optimization is disabled by default as the implementation was not properly tested. If you want to experiment with JIT you need to compile with:

MONERO_NO_JIT=0 python setup.py install
MONERO_USE_CNV4_JIT=1 ./test.sh

To rebuild locally and test:

MONERO_NO_AES=0 MONERO_NO_JIT=0 python setup.py develop
MONERO_USE_CNV4_JIT=0 ./test.sh  # JIT disabled
MONERO_USE_CNV4_JIT=1 ./test.sh  # JIT enabled

For more info read JIT.md

Donations

Thanks for your support!

86SgqL4YwtWBgq65CitxbPC5ChUJrDkTVWJgtenuf6S68GTLWqPh3zydYpoFhr8JyVdWEZmoMMnhjdvoKQ9urZFfCXKmD93

py-cryptonight's People

Contributors

jtgrassie avatar ph4r05 avatar suwakommh avatar xxazesxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

py-cryptonight's Issues

Error installing on Windows 10

Thanks for this great project! It is working for me on macOS, however, I am struggling to get it working on Windows. Here is what I have tried so far:

  1. First error was fatal error: cannot include 'stdint.h' - no such file or directory. I did a bit of research and think I fixed this by downloading stdint.h from here https://github.com/chemeris/msinttypes/blob/master/stdint.h and putting it in C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\.

  2. Next error was fatal error: cannot include 'stdbool.h' - no such file or directory. I applied the same kind of fix for this (i.e. downloading stdbool.h and putting it in the C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\ directory.

  3. Now that I'm not getting the errors above, I am getting a long stream of syntax errors that eventually exceeds 100 and crashes - see output below:

Installing collected packages: py-cryptonight
Running setup.py install for py-cryptonight ... error
ERROR: Command errored out with exit status 1:
command: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"'; file='"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'c:\users\malwaredllc\appdata\local\temp\pip-record-bobd5h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\py-cryptonight'
cwd: c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight
Complete output (141 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\pycryptonight
copying pycryptonight_init_.py -> build\lib.win-amd64-2.7\pycryptonight
creating build\lib.win-amd64-2.7\pycryptonight\tests
copying pycryptonight\tests\test.py -> build\lib.win-amd64-2.7\pycryptonight\tests
copying pycryptonight\tests_init_.py -> build\lib.win-amd64-2.7\pycryptonight\tests
running egg_info
writing requirements to py_cryptonight.egg-info\requires.txt
writing py_cryptonight.egg-info\PKG-INFO
writing top-level names to py_cryptonight.egg-info\top_level.txt
writing dependency_links to py_cryptonight.egg-info\dependency_links.txt
reading manifest file 'py_cryptonight.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'py_cryptonight.egg-info\SOURCES.txt'
creating build\lib.win-amd64-2.7\pycryptonight\tests\data
copying pycryptonight\tests\data\tests-fast.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data
copying pycryptonight\tests\data\tests-slow-1.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data
copying pycryptonight\tests\data\tests-slow-2.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data
copying pycryptonight\tests\data\tests-slow-4.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data
copying pycryptonight\tests\data\tests-slow.txt -> build\lib.win-amd64-2.7\pycryptonight\tests\data
running build_ext
building '_pycryptonight' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\src
creating build\temp.win-amd64-2.7\Release\src\cryptonight
C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/aesb.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/aesb.obj
aesb.c
C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/blake256.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/blake256.obj
blake256.c
src/cryptonight/blake256.c(180) : warning C4244: '=' : conversion from 'uint64_t' to 'int', possible loss of data
C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DNO_AES=1 -DNO_JIT=1 -I. -Isrc/ -Isrc/misc -Isrc/cryptonight -Ic:\python27\include -Ic:\python27\PC /Tcsrc/cryptonight/CryptonightR_JIT.c /Fobuild\temp.win-amd64-2.7\Release\src/cryptonight/CryptonightR_JIT.obj
CryptonightR_JIT.c
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2085: 'rol32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(53) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2085: 'rol64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(58) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2085: 'hi_dword' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(74) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2085: 'lo_dword' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(78) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2085: 'mul128' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(82) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2085: 'div_with_reminder' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(108) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2085: 'div128_32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(115) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2085: 'ident32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(148) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2085: 'ident64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(149) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2085: 'swap32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(155) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2085: 'swap64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(163) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2085: 'mem_inplace_ident' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(176) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2085: 'mem_inplace_swap32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(179) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2085: 'mem_inplace_swap64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(185) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2085: 'memcpy_ident32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(192) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2085: 'memcpy_ident64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(195) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2085: 'memcpy_swap32' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(199) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2085: 'memcpy_swap64' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\int-util.h(205) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2085: 'padd' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(43) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(47) : error C2143: syntax error : missing '{' before 'const'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2143: syntax error : missing ')' before 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2143: syntax error : missing '{' before 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(53) : error C2059: syntax error : 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2085: 'place_length' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(54) : error C2143: syntax error : missing ';' before '{'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2143: syntax error : missing ')' before 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2143: syntax error : missing '{' before 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\hash-ops.h(69) : error C2059: syntax error : 'sizeof'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(182) : error C2054: expected '(' to follow 'inline'
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(183) : error C2085: 'v4_random_math_init' : not in formal parameter list
c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\src\cryptonight\variant4_random_math.h(183) : error C2143: syntax error : missing ';' before '{'
src/cryptonight/CryptonightR_JIT.c(174) : error C2143: syntax error : missing ';' before 'type'
src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type'
src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type'
src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ')' before 'type'
src/cryptonight/CryptonightR_JIT.c(176) : error C2143: syntax error : missing ';' before 'type'
src/cryptonight/CryptonightR_JIT.c(176) : error C2059: syntax error : ')'
src/cryptonight/CryptonightR_JIT.c(177) : error C2065: 'i' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(177) : error C2143: syntax error : missing ';' before '{'
src/cryptonight/CryptonightR_JIT.c(178) : error C2065: 'i' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(180) : error C2043: illegal break
src/cryptonight/CryptonightR_JIT.c(182) : error C2143: syntax error : missing ';' before 'type'
src/cryptonight/CryptonightR_JIT.c(184) : error C2143: syntax error : missing ';' before 'const'
src/cryptonight/CryptonightR_JIT.c(185) : error C2143: syntax error : missing ';' before 'const'
src/cryptonight/CryptonightR_JIT.c(186) : error C2143: syntax error : missing ';' before 'const'
src/cryptonight/CryptonightR_JIT.c(192) : error C2065: 'b' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(192) : error C2065: 'prev_rot_src' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(194) : error C2065: 'prev_rot_src' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(194) : error C2065: 'b' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(202) : error C2143: syntax error : missing ';' before 'const'
src/cryptonight/CryptonightR_JIT.c(203) : error C2143: syntax error : missing ';' before 'const'
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : warning C4022: 'memcpy' : pointer mismatch for actual parameter 2
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p2' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(206) : error C2065: 'p1' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(211) : error C2065: 'a' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(211) : error C2065: 'prev_rot_src' : undeclared identifier
src/cryptonight/CryptonightR_JIT.c(211) : fatal error C1003: error count exceeds 100; stopping compilation
error: command 'C:\Users\malwaredllc\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\python27\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"'; file='"'"'c:\users\malwaredllc\appdata\local\temp\pip-install-bhr4io\py-cryptonight\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'c:\users\malwaredllc\appdata\local\temp\pip-record-bobd5h\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python27\Include\py-cryptonight' Check the logs for full command output.

Pyre Python3 wheel

Hello!
Is it possible to create a pyre Python3 wheel from py-cryptonight?

I can't install py-cryptonight

pip install py-cryptonight

Collecting py-cryptonight Using cached py_cryptonight-0.3.3.tar.gz (352 kB) Building wheels for collected packages: py-cryptonight Building wheel for py-cryptonight (setup.py) ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"'; file='"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-k4cdqjd3 cwd: /tmp/pip-install-0gece5x4/py-cryptonight/ Complete output (36 lines): running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/pycryptonight copying pycryptonight/init.py -> build/lib.linux-x86_64-3.8/pycryptonight creating build/lib.linux-x86_64-3.8/pycryptonight/tests copying pycryptonight/tests/test.py -> build/lib.linux-x86_64-3.8/pycryptonight/tests copying pycryptonight/tests/init.py -> build/lib.linux-x86_64-3.8/pycryptonight/tests running egg_info writing py_cryptonight.egg-info/PKG-INFO writing dependency_links to py_cryptonight.egg-info/dependency_links.txt writing requirements to py_cryptonight.egg-info/requires.txt writing top-level names to py_cryptonight.egg-info/top_level.txt reading manifest file 'py_cryptonight.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'py_cryptonight.egg-info/SOURCES.txt' creating build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-fast.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-1.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-2.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-4.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data running build_ext building '_pycryptonight' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/src creating build/temp.linux-x86_64-3.8/src/cryptonight x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNO_JIT=1 -I. -Isrc/ -Isrc/cryptonight -I/usr/include/python3.8 -c src/cryptonight/aesb.c -o build/temp.linux-x86_64-3.8/src/cryptonight/aesb.o -std=gnu11 -maes In file included from src/cryptonight/aesb.c:21: /usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory 9 | # include_next <stdint.h> | ^~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for py-cryptonight Running setup.py clean for py-cryptonight Failed to build py-cryptonight Installing collected packages: py-cryptonight Running setup.py install for py-cryptonight ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"'; file='"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-7ntvygnk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ezequiel/.local/include/python3.8/py-cryptonight cwd: /tmp/pip-install-0gece5x4/py-cryptonight/ Complete output (36 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/pycryptonight copying pycryptonight/init.py -> build/lib.linux-x86_64-3.8/pycryptonight creating build/lib.linux-x86_64-3.8/pycryptonight/tests copying pycryptonight/tests/test.py -> build/lib.linux-x86_64-3.8/pycryptonight/tests copying pycryptonight/tests/init.py -> build/lib.linux-x86_64-3.8/pycryptonight/tests running egg_info writing py_cryptonight.egg-info/PKG-INFO writing dependency_links to py_cryptonight.egg-info/dependency_links.txt writing requirements to py_cryptonight.egg-info/requires.txt writing top-level names to py_cryptonight.egg-info/top_level.txt reading manifest file 'py_cryptonight.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'py_cryptonight.egg-info/SOURCES.txt' creating build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-fast.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-1.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-2.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow-4.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data copying pycryptonight/tests/data/tests-slow.txt -> build/lib.linux-x86_64-3.8/pycryptonight/tests/data running build_ext building '_pycryptonight' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/src creating build/temp.linux-x86_64-3.8/src/cryptonight x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNO_JIT=1 -I. -Isrc/ -Isrc/cryptonight -I/usr/include/python3.8 -c src/cryptonight/aesb.c -o build/temp.linux-x86_64-3.8/src/cryptonight/aesb.o -std=gnu11 -maes In file included from src/cryptonight/aesb.c:21: /usr/lib/gcc/x86_64-linux-gnu/9/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory 9 | # include_next <stdint.h> | ^~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"'; file='"'"'/tmp/pip-install-0gece5x4/py-cryptonight/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-7ntvygnk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/ezequiel/.local/include/python3.8/py-cryptonight Check the logs for full command output.

Error while installing pycryptonight

error: subprocess-exited-with-error

× Building wheel for pycryptonight (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
aesb.c
cl : Command line warning D9002 : ignoring unknown option '-std=gnu99'
c_blake256.c
crypto/c_blake256.c(14): fatal error C1083: Cannot open include file: 'c_blake256.h': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycryptonight
Failed to build pycryptonight
ERROR: Could not build wheels for pycryptonight, which is required to install pyproject.toml-based projects

Monero CNv4 Hard Fork

Hello,
I appreciate all of the work you put into this! I use it regularly for Python Monero mining, but the CNv4 or Cryptonight R hardfork is coming up and I wanted to know if you could update the code so I could mine again. Thank you for making this and best of luck!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.