├── src ├── Hashing │ ├── .gitignore │ ├── libcryptonote │ │ ├── contrib │ │ │ └── epee │ │ │ │ └── include │ │ │ │ ├── net │ │ │ │ ├── levin_client_async.inl │ │ │ │ ├── local_ip.h │ │ │ │ ├── rpc_method_name.h │ │ │ │ ├── levin_server_cp.h │ │ │ │ └── http_server_thread_per_connect.h │ │ │ │ ├── serialization │ │ │ │ └── serialize_base.h │ │ │ │ ├── pragma_comp_defs.h │ │ │ │ ├── warnings.h │ │ │ │ ├── readline_buffer.h │ │ │ │ ├── include_base_utils.h │ │ │ │ └── global_stream_operators.h │ │ ├── stdafx.cpp │ │ ├── targetver.h │ │ ├── dllmain.cpp │ │ ├── stdafx.h │ │ ├── packages.config │ │ ├── crypto │ │ │ ├── keccak.h │ │ │ ├── jh.h │ │ │ ├── random.h │ │ │ ├── hash-extra-blake.c │ │ │ ├── hash-extra-groestl.c │ │ │ ├── skein.h │ │ │ ├── hash-extra-skein.c │ │ │ ├── hash-extra-jh.c │ │ │ └── oaes_config.h │ │ ├── Makefile │ │ ├── Makefile.MSys2 │ │ ├── libcryptonote.sln │ │ ├── cryptonote_protocol │ │ │ └── blobdatatype.h │ │ ├── ringct │ │ │ └── rctCryptoOps.h │ │ └── common │ │ │ └── pod-class.h │ └── libmultihash │ │ ├── x13.h │ │ ├── x14.h │ │ ├── boolberry.h │ │ ├── bcrypt.h │ │ ├── c11.h │ │ ├── jh.h │ │ ├── s3.h │ │ ├── nist5.h │ │ ├── x11.h │ │ ├── x15.h │ │ ├── blake.h │ │ ├── fresh.h │ │ ├── fugue.h │ │ ├── quark.h │ │ ├── qubit.h │ │ ├── skein.h │ │ ├── hefty1.h │ │ ├── keccak.h │ │ ├── dcrypt.h │ │ ├── shavite3.h │ │ ├── Lyra2RE.h │ │ ├── stdafx.cpp │ │ ├── fugue.c │ │ ├── targetver.h │ │ ├── groestl.h │ │ ├── windows │ │ └── include │ │ │ └── libsodium │ │ │ └── sodium │ │ │ ├── core.h │ │ │ ├── randombytes_sysrandom.h │ │ │ ├── randombytes_salsa20_random.h │ │ │ ├── crypto_verify_16.h │ │ │ ├── crypto_verify_32.h │ │ │ ├── crypto_verify_64.h │ │ │ ├── version.h │ │ │ ├── crypto_scalarmult_curve25519.h │ │ │ ├── crypto_core_salsa20.h │ │ │ ├── crypto_core_hsalsa20.h │ │ │ ├── crypto_core_salsa208.h │ │ │ ├── crypto_core_hchacha20.h │ │ │ ├── crypto_core_salsa2012.h │ │ │ ├── runtime.h │ │ │ ├── crypto_scalarmult.h │ │ │ ├── crypto_hash.h │ │ │ ├── crypto_shorthash.h │ │ │ ├── export.h │ │ │ ├── crypto_auth.h │ │ │ ├── crypto_kdf_blake2b.h │ │ │ ├── crypto_shorthash_siphash24.h │ │ │ ├── crypto_kdf.h │ │ │ ├── crypto_stream_salsa208.h │ │ │ ├── crypto_stream_salsa2012.h │ │ │ ├── crypto_stream.h │ │ │ ├── crypto_hash_sha256.h │ │ │ ├── crypto_hash_sha512.h │ │ │ ├── crypto_stream_salsa20.h │ │ │ ├── crypto_stream_xsalsa20.h │ │ │ ├── crypto_stream_xchacha20.h │ │ │ ├── randombytes.h │ │ │ ├── crypto_onetimeauth.h │ │ │ ├── crypto_sign_edwards25519sha512batch.h │ │ │ └── crypto_secretbox_xsalsa20poly1305.h │ │ ├── keccak.c │ │ ├── net-core-test │ │ ├── net-core-test.csproj │ │ ├── net-core-test.sln │ │ └── Program.cs │ │ ├── jh.c │ │ ├── libethash │ │ ├── sha3_cryptopp.h │ │ ├── sha3.h │ │ ├── compiler.h │ │ ├── sha3_cryptopp.cpp │ │ ├── util_win32.c │ │ ├── util.h │ │ ├── fnv.h │ │ └── mmap.h │ │ ├── blake.c │ │ ├── scryptn.h │ │ ├── stdafx.h │ │ ├── dllmain.cpp │ │ ├── shavite3.c │ │ ├── skein.c │ │ ├── neoscrypt.h │ │ ├── s3.c │ │ ├── groestl.c │ │ ├── Makefile │ │ ├── scryptjane.h │ │ ├── fresh.c │ │ ├── equi │ │ └── equi.h │ │ ├── nist5.c │ │ ├── libmultihash.sln │ │ ├── qubit.c │ │ └── sha3 │ │ └── sph_fugue.h ├── Tests │ ├── Hypepool.Benchmarks │ │ ├── .gitignore │ │ ├── Hypepool.Benchmarks.csproj │ │ ├── Program.cs │ │ └── Utils │ │ │ └── Helpers │ │ │ └── Time │ │ │ └── FastClock.cs │ ├── Hypepool.Core.Tests │ │ ├── Core │ │ │ └── Internals │ │ │ │ └── ContainerTests.cs │ │ ├── Utils │ │ │ └── Buffers │ │ │ │ └── PooledLineBufferTests.cs │ │ └── Hypepool.Core.Tests.csproj │ ├── Hypepool.Common.Tests │ │ └── Hypepool.Common.Tests.csproj │ └── Hypepool.Monero.Tests │ │ └── Hypepool.Monero.Tests.csproj ├── Core │ ├── Hypepool.Common │ │ ├── Pools │ │ │ ├── PoolBase.cs │ │ │ ├── PoolStartupAbortedException.cs │ │ │ └── IPool.cs │ │ ├── Shares │ │ │ ├── IShare.cs │ │ │ └── ShareBase.cs │ │ ├── Mining │ │ │ └── Jobs │ │ │ │ ├── IJob.cs │ │ │ │ ├── IWorkerJob.cs │ │ │ │ ├── IJobManager.cs │ │ │ │ └── JobCounter.cs │ │ ├── Hypepool.Common.csproj │ │ ├── Factories │ │ │ └── Server │ │ │ │ └── IServerFactory.cs │ │ ├── Daemon │ │ │ ├── DaemonResponse.cs │ │ │ └── DaemonException.cs │ │ ├── JsonRpc │ │ │ └── JsonSerializerSettings.cs │ │ └── Stratum │ │ │ ├── StratumError.cs │ │ │ └── IStratumServer.cs │ └── Hypepool.Core │ │ ├── Utils │ │ ├── Buffers │ │ │ └── PooledLineBuffer.cs │ │ ├── Extensions │ │ │ └── AssemblyExtensions.cs │ │ └── Logging │ │ │ └── ILogManager.cs │ │ ├── Internals │ │ ├── Bootstrap │ │ │ └── IBootstrapper.cs │ │ ├── Factories │ │ │ ├── Pool │ │ │ │ └── IPoolFactory.cs │ │ │ ├── Core │ │ │ │ ├── ICoreFactory.cs │ │ │ │ └── CoreFactory.cs │ │ │ └── Server │ │ │ │ └── ServerFactory.cs │ │ └── Registries │ │ │ ├── IRegistry.cs │ │ │ ├── ServerRegistry.cs │ │ │ └── CoreRegistry.cs │ │ ├── Stratum │ │ ├── StratumConstants.cs │ │ └── StratumException.cs │ │ ├── Core │ │ └── IEngine.cs │ │ └── Hypepool.Core.csproj └── Blockchains │ └── Monero │ ├── Hypepool.Monero.csproj │ ├── MoneroShare.cs │ ├── Daemon │ ├── Responses │ │ ├── GetAddressResponse.cs │ │ └── GetBlockTemplateResponse.cs │ └── Requests │ │ └── GetBlockTemplateRequest.cs │ ├── Stratum │ ├── Responses │ │ ├── MoneroResponseBase.cs │ │ └── MoneroLoginResponse.cs │ └── Requests │ │ └── MoneroLoginRequest.cs │ └── MoneroWorkerContext.cs ├── renovate.json ├── deps └── windows │ ├── x64 │ ├── libcryptonote.dll │ └── libmultihash.dll │ └── x86 │ ├── libcryptonote.dll │ └── libmultihash.dll ├── appveyor.yml ├── .github ├── issue_template.md └── pull_request_template.md ├── .circleci └── config.yml ├── package.json ├── LICENSE ├── Gruntfile.js └── CONTRIBUTING.md /src/Hashing/.gitignore: -------------------------------------------------------------------------------- 1 | boost_1_66_0/ -------------------------------------------------------------------------------- /src/Tests/Hypepool.Benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | BenchmarkDotNet.Artifacts/ -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/net/levin_client_async.inl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/serialization/serialize_base.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | -------------------------------------------------------------------------------- /deps/windows/x64/libcryptonote.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/deps/windows/x64/libcryptonote.dll -------------------------------------------------------------------------------- /deps/windows/x64/libmultihash.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/deps/windows/x64/libmultihash.dll -------------------------------------------------------------------------------- /deps/windows/x86/libcryptonote.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/deps/windows/x86/libcryptonote.dll -------------------------------------------------------------------------------- /deps/windows/x86/libmultihash.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/deps/windows/x86/libmultihash.dll -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Pools/PoolBase.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/src/Core/Hypepool.Common/Pools/PoolBase.cs -------------------------------------------------------------------------------- /src/Hashing/libmultihash/x13.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void x13_hash(const char* input, char* output, uint32_t len); 6 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/x14.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | void x14_hash(const char* input, char* output, uint32_t len); 6 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Utils/Buffers/PooledLineBuffer.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/src/Core/Hypepool.Core/Utils/Buffers/PooledLineBuffer.cs -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/net/local_ip.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/src/Hashing/libcryptonote/contrib/epee/include/net/local_ip.h -------------------------------------------------------------------------------- /src/Tests/Hypepool.Core.Tests/Core/Internals/ContainerTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/src/Tests/Hypepool.Core.Tests/Core/Internals/ContainerTests.cs -------------------------------------------------------------------------------- /src/Tests/Hypepool.Core.Tests/Utils/Buffers/PooledLineBufferTests.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonesoul/hypepool/HEAD/src/Tests/Hypepool.Core.Tests/Utils/Buffers/PooledLineBufferTests.cs -------------------------------------------------------------------------------- /src/Hashing/libmultihash/boolberry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | void boolberry_hash(const char* input, uint32_t input_len, const char* scratchpad, uint64_t spad_length, char* output, uint64_t height); 7 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/bcrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef BCRYPT_H 2 | #define BCRYPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void bcrypt_hash(const char *input, char *output); 9 | 10 | #ifdef __cplusplus 11 | } 12 | #endif 13 | 14 | #endif -------------------------------------------------------------------------------- /src/Hashing/libmultihash/c11.h: -------------------------------------------------------------------------------- 1 | #ifndef C11_H 2 | #define C11_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void c11_hash(const char* input, char* output); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/jh.h: -------------------------------------------------------------------------------- 1 | #ifndef JHA_H 2 | #define JHA_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void jh_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/s3.h: -------------------------------------------------------------------------------- 1 | #ifndef S3_H 2 | #define S3_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void s3_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/nist5.h: -------------------------------------------------------------------------------- 1 | #ifndef NIST5_H 2 | #define NIST5_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void nist5_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif -------------------------------------------------------------------------------- /src/Hashing/libmultihash/x11.h: -------------------------------------------------------------------------------- 1 | #ifndef X11_H 2 | #define X11_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void x11_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/x15.h: -------------------------------------------------------------------------------- 1 | #ifndef X15_H 2 | #define X15_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void x15_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/blake.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAKE_H 2 | #define BLAKE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void blake_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/fresh.h: -------------------------------------------------------------------------------- 1 | #ifndef FRESH_H 2 | #define FRESH_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void fresh_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/fugue.h: -------------------------------------------------------------------------------- 1 | #ifndef FUGUE_H 2 | #define FUGUE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void fugue_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/quark.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARK_H 2 | #define QUARK_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void quark_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/qubit.h: -------------------------------------------------------------------------------- 1 | #ifndef QUBIT_H 2 | #define QUBIT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void qubit_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/skein.h: -------------------------------------------------------------------------------- 1 | #ifndef SKEIN_H 2 | #define SKEIN_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void skein_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/hefty1.h: -------------------------------------------------------------------------------- 1 | #ifndef HEFTY1_H 2 | #define HEFTY1_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void hefty1_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/keccak.h: -------------------------------------------------------------------------------- 1 | #ifndef KECCAK_H 2 | #define KECCAK_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void keccak_hash(const char* input, char* output, uint32_t size); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/dcrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef DCRYPT_H 2 | #define DCRYPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void dcrypt_hash(const char* input, char* hash, uint32_t len); 11 | 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/shavite3.h: -------------------------------------------------------------------------------- 1 | #ifndef SHAVITE_H 2 | #define SHAVITE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void shavite3_hash(const char* input, char* output, uint32_t len); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/Lyra2RE.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRA2RE_H 2 | #define LYRA2RE_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void lyra2re_hash(const char* input, char* output); 9 | void lyra2re2_hash(const char* input, char* output); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // $safeprojectname$.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // $safeprojectname$.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/fugue.c: -------------------------------------------------------------------------------- 1 | #include "fugue.h" 2 | 3 | #include "sha3/sph_fugue.h" 4 | 5 | void fugue_hash(const char* input, char* output, uint32_t len) 6 | { 7 | sph_fugue256_context ctx_fugue; 8 | sph_fugue256_init(&ctx_fugue); 9 | sph_fugue256(&ctx_fugue, input, len); 10 | sph_fugue256_close(&ctx_fugue, output); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/groestl.h: -------------------------------------------------------------------------------- 1 | #ifndef GROESTL_H 2 | #define GROESTL_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | 10 | void groestl_hash(const char* input, char* output, uint32_t len); 11 | void groestlmyriad_hash(const char* input, char* output, uint32_t len); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/core.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_core_H 3 | #define sodium_core_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_init(void) 13 | __attribute__ ((warn_unused_result)); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/keccak.c: -------------------------------------------------------------------------------- 1 | #include "keccak.h" 2 | 3 | #include "sha3/sph_types.h" 4 | #include "sha3/sph_keccak.h" 5 | 6 | 7 | void keccak_hash(const char* input, char* output, uint32_t size) 8 | { 9 | sph_keccak256_context ctx_keccak; 10 | sph_keccak256_init(&ctx_keccak); 11 | sph_keccak256 (&ctx_keccak, input, size);//80); 12 | sph_keccak256_close(&ctx_keccak, output); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/net-core-test/net-core-test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp1.1 6 | 7 | 8 | 9 | True 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/jh.c: -------------------------------------------------------------------------------- 1 | #include "jh.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "sha3/sph_jh.h" 8 | 9 | 10 | void jh_hash(const char* input, char* output, uint32_t len) { 11 | 12 | sph_jh256_context ctx_jh; 13 | sph_jh256_init(&ctx_jh); 14 | sph_jh256 (&ctx_jh, input, len); 15 | sph_jh256_close(&ctx_jh, output); 16 | 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/sha3_cryptopp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "compiler.h" 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | struct ethash_h256; 12 | 13 | void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t size); 14 | void SHA3_512(uint8_t* const ret, uint8_t const* data, size_t size); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/randombytes_sysrandom.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_sysrandom_H 3 | #define randombytes_sysrandom_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_sysrandom_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/blake.c: -------------------------------------------------------------------------------- 1 | #include "blake.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_blake.h" 8 | 9 | 10 | void blake_hash(const char* input, char* output, uint32_t len) 11 | { 12 | sph_blake256_context ctx_blake; 13 | sph_blake256_init(&ctx_blake); 14 | sph_blake256(&ctx_blake, input, len); 15 | sph_blake256_close(&ctx_blake, output); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/randombytes_salsa20_random.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_salsa20_random_H 3 | #define randombytes_salsa20_random_H 4 | 5 | #include "export.h" 6 | #include "randombytes.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | SODIUM_EXPORT 13 | extern struct randombytes_implementation randombytes_salsa20_implementation; 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | image: Visual Studio 2017 2 | 3 | build_script: 4 | - dotnet build hypepool.sln 5 | 6 | test_script: 7 | - cd src\Tests\ 8 | - cd Hypepool.Core.Tests\ && dotnet xunit 9 | - cd .. && cd Hypepool.Common.Tests\ && dotnet xunit 10 | - cd .. && cd Hypepool.Monero.Tests\ && dotnet xunit 11 | - cd .. && cd Hypepool.Benchmarks\ && dotnet build --configuration Release && cd bin/Release/netcoreapp2.0/ && dotnet Hypepool.Benchmarks.dll 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/scryptn.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRYPTN_H 2 | #define SCRYPTN_H 3 | #include 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void scrypt_N_R_1_256(const char* input, char* output, uint32_t N, uint32_t R, uint32_t len); 9 | void scrypt_N_R_1_256_sp(const char* input, char* output, char* scratchpad, uint32_t N, uint32_t R, uint32_t len); 10 | //const int scrypt_scratchpad_size = 131583; 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include "targetver.h" 9 | 10 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 11 | // Windows Header Files: 12 | #include 13 | 14 | 15 | 16 | // TODO: reference additional headers your program requires here 17 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : Defines the entry point for the DLL application. 2 | #include "stdafx.h" 3 | 4 | BOOL APIENTRY DllMain( HMODULE hModule, 5 | DWORD ul_reason_for_call, 6 | LPVOID lpReserved 7 | ) 8 | { 9 | switch (ul_reason_for_call) 10 | { 11 | case DLL_PROCESS_ATTACH: 12 | case DLL_THREAD_ATTACH: 13 | case DLL_THREAD_DETACH: 14 | case DLL_PROCESS_DETACH: 15 | break; 16 | } 17 | return TRUE; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_verify_16.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_16_H 2 | #define crypto_verify_16_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_16_BYTES 16U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_16_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_16(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_verify_32.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_32_H 2 | #define crypto_verify_32_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_32_BYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_32_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_32(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_verify_64.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_verify_64_H 2 | #define crypto_verify_64_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_verify_64_BYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_verify_64_bytes(void); 14 | 15 | SODIUM_EXPORT 16 | int crypto_verify_64(const unsigned char *x, const unsigned char *y) 17 | __attribute__ ((warn_unused_result)); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/pragma_comp_defs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__GNUC__) 4 | #define PRAGMA_WARNING_PUSH _Pragma("GCC diagnostic push") 5 | #define PRAGMA_WARNING_POP _Pragma("GCC diagnostic pop") 6 | #define PRAGMA_WARNING_DISABLE_VS(w) 7 | #define PRAGMA_GCC(w) _Pragma(w) 8 | #elif defined(_MSC_VER) 9 | #define PRAGMA_WARNING_PUSH __pragma(warning( push )) 10 | #define PRAGMA_WARNING_POP __pragma(warning( pop )) 11 | #define PRAGMA_WARNING_DISABLE_VS(w) __pragma( warning ( disable: w )) 12 | //#define PRAGMA_WARNING_DISABLE_GCC(w) 13 | #define PRAGMA_GCC(w) 14 | #endif 15 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | 3 | [Description of the issue] 4 | 5 | ### Steps to Reproduce 6 | 7 | 1. [First Step] 8 | 2. [Second Step] 9 | 3. [and so on...] 10 | 11 | **Expected behavior:** [What you expect to happen] 12 | 13 | **Actual behavior:** [What actually happens] 14 | 15 | **Reproduces how often:** [What percentage of the time does it reproduce?] 16 | 17 | ### Versions 18 | 19 | You can get this information from copy and pasting the output startup output of hypepool. 20 | 21 | ### Additional Information 22 | 23 | Any additional information, configuration or data that might be necessary to reproduce the issue. 24 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Utils/Extensions/AssemblyExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Reflection; 5 | 6 | namespace Hypepool.Core.Utils.Extensions 7 | { 8 | public static class AssemblyExtensions 9 | { 10 | public static IEnumerable DiscoverTypes(this Assembly assembly, Type type) 11 | { 12 | return (from t in assembly.GetExportedTypes() 13 | where type.IsAssignableFrom(t) 14 | where !t.IsAbstract 15 | where !t.IsGenericTypeDefinition 16 | select t).ToArray(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: /temp 5 | docker: 6 | - image: microsoft/dotnet:latest 7 | environment: 8 | DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 9 | DOTNET_CLI_TELEMETRY_OPTOUT: 1 10 | steps: 11 | - checkout 12 | - run: dotnet build hypepool.sln 13 | - run: cd src/Tests/Hypepool.Core.Tests/ && dotnet xunit 14 | - run: cd src/Tests/Hypepool.Common.Tests/ && dotnet xunit 15 | - run: cd src/Tests/Hypepool.Monero.Tests/ && dotnet xunit 16 | - run: cd src/Tests/Hypepool.Benchmarks/ && dotnet build --configuration Release && cd bin/Release/netcoreapp2.0/ && dotnet Hypepool.Benchmarks.dll -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/keccak.h: -------------------------------------------------------------------------------- 1 | // keccak.h 2 | // 19-Nov-11 Markku-Juhani O. Saarinen 3 | 4 | #ifndef KECCAK_H 5 | #define KECCAK_H 6 | 7 | #include 8 | #include 9 | 10 | #ifndef KECCAK_ROUNDS 11 | #define KECCAK_ROUNDS 24 12 | #endif 13 | 14 | #ifndef ROTL64 15 | #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) 16 | #endif 17 | 18 | // compute a keccak hash (md) of given byte length from "in" 19 | int keccak(const uint8_t *in, size_t inlen, uint8_t *md, int mdlen); 20 | 21 | // update the state 22 | void keccakf(uint64_t st[25], int norounds); 23 | 24 | void keccak1600(const uint8_t *in, size_t inlen, uint8_t *md); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/shavite3.c: -------------------------------------------------------------------------------- 1 | #include "shavite3.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "sha3/sph_shavite.h" 7 | 8 | void shavite3_hash(const char* input, char* output, uint32_t len) 9 | { 10 | char hash1[64]; 11 | char hash2[64]; 12 | 13 | sph_shavite512_context ctx_shavite; 14 | 15 | sph_shavite512_init(&ctx_shavite); 16 | sph_shavite512(&ctx_shavite, (const void*) input, len); 17 | sph_shavite512_close(&ctx_shavite, (void*) &hash1); 18 | 19 | sph_shavite512(&ctx_shavite, (const void*) &hash1, 64); 20 | sph_shavite512_close(&ctx_shavite, (void*) &hash2); 21 | 22 | memcpy(output, &hash2, 32); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/skein.c: -------------------------------------------------------------------------------- 1 | #include "skein.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_skein.h" 8 | #include "sha256.h" 9 | 10 | #include 11 | 12 | void skein_hash(const char* input, char* output, uint32_t len) 13 | { 14 | char temp[64]; 15 | 16 | sph_skein512_context ctx_skien; 17 | sph_skein512_init(&ctx_skien); 18 | sph_skein512(&ctx_skien, input, len); 19 | sph_skein512_close(&ctx_skien, &temp); 20 | 21 | SHA256_CTX ctx_sha256; 22 | SHA256_Init(&ctx_sha256); 23 | SHA256_Update(&ctx_sha256, &temp, 64); 24 | SHA256_Final((unsigned char*) output, &ctx_sha256); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/sha3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include "compiler.h" 8 | #include 9 | #include 10 | 11 | struct ethash_h256; 12 | 13 | #define decsha3(bits) \ 14 | int sha3_##bits(uint8_t*, size_t, uint8_t const*, size_t); 15 | 16 | decsha3(256) 17 | decsha3(512) 18 | 19 | static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t const size) 20 | { 21 | sha3_256((uint8_t*)ret, 32, data, size); 22 | } 23 | 24 | static inline void SHA3_512(uint8_t* ret, uint8_t const* data, size_t const size) 25 | { 26 | sha3_512(ret, 64, data, size); 27 | } 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/version.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_version_H 3 | #define sodium_version_H 4 | 5 | #include "export.h" 6 | 7 | #define SODIUM_VERSION_STRING "1.0.13" 8 | 9 | #define SODIUM_LIBRARY_VERSION_MAJOR 9 10 | #define SODIUM_LIBRARY_VERSION_MINOR 5 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | SODIUM_EXPORT 18 | const char *sodium_version_string(void); 19 | 20 | SODIUM_EXPORT 21 | int sodium_library_version_major(void); 22 | 23 | SODIUM_EXPORT 24 | int sodium_library_version_minor(void); 25 | 26 | SODIUM_EXPORT 27 | int sodium_library_minimal(void); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hypepool", 3 | "version": "0.0.1", 4 | "private": true, 5 | "description": "hypepool build system.", 6 | "os": [ 7 | "linux", 8 | "darwin", 9 | "win32" 10 | ], 11 | "cpu": [ 12 | "x64", 13 | "ia32" 14 | ], 15 | "author": "Huseyin Uslu (http://www.int6ware.com)", 16 | "homepage": "https://github.com/bonesoul/hypepool", 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/bonesoul/hypepool.git" 20 | }, 21 | "bugs": { 22 | "url": "https://github.com/bonesoul/hypepool/issues" 23 | }, 24 | "devDependencies": { 25 | "grunt": "1.0.1", 26 | "grunt-shell": "2.1.0", 27 | "load-grunt-tasks": "3.5.2", 28 | "time-grunt": "1.4.0" 29 | }, 30 | "engines": { 31 | "node": ">=9.4.0", 32 | "npm": ">=5.6.0" 33 | }, 34 | "dependencies": { 35 | "grunt-cli": "1.2.0" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/jh.h: -------------------------------------------------------------------------------- 1 | /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C 2 | 3 | -------------------------------- 4 | Performance 5 | 6 | Microprocessor: Intel CORE 2 processor (Core 2 Duo Mobile T6600 2.2GHz) 7 | Operating System: 64-bit Ubuntu 10.04 (Linux kernel 2.6.32-22-generic) 8 | Speed for long message: 9 | 1) 45.8 cycles/byte compiler: Intel C++ Compiler 11.1 compilation option: icc -O2 10 | 2) 56.8 cycles/byte compiler: gcc 4.4.3 compilation option: gcc -O3 11 | 12 | -------------------------------- 13 | Last Modified: January 16, 2011 14 | */ 15 | #pragma once 16 | 17 | typedef unsigned char BitSequence; 18 | typedef unsigned long long DataLength; 19 | typedef enum {SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2} HashReturn; 20 | 21 | HashReturn jh_hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); 22 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_scalarmult_curve25519.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_curve25519_H 2 | #define crypto_scalarmult_curve25519_H 3 | 4 | #include 5 | 6 | #include "export.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #define crypto_scalarmult_curve25519_BYTES 32U 13 | SODIUM_EXPORT 14 | size_t crypto_scalarmult_curve25519_bytes(void); 15 | 16 | #define crypto_scalarmult_curve25519_SCALARBYTES 32U 17 | SODIUM_EXPORT 18 | size_t crypto_scalarmult_curve25519_scalarbytes(void); 19 | 20 | SODIUM_EXPORT 21 | int crypto_scalarmult_curve25519(unsigned char *q, const unsigned char *n, 22 | const unsigned char *p) 23 | __attribute__ ((warn_unused_result)); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_core_salsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa20_H 2 | #define crypto_core_salsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa20_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa20_outputbytes(void); 14 | 15 | #define crypto_core_salsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa20_inputbytes(void); 18 | 19 | #define crypto_core_salsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa20_keybytes(void); 22 | 23 | #define crypto_core_salsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_core_hsalsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_hsalsa20_H 2 | #define crypto_core_hsalsa20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_hsalsa20_OUTPUTBYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_core_hsalsa20_outputbytes(void); 14 | 15 | #define crypto_core_hsalsa20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_hsalsa20_inputbytes(void); 18 | 19 | #define crypto_core_hsalsa20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_hsalsa20_keybytes(void); 22 | 23 | #define crypto_core_hsalsa20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_hsalsa20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_hsalsa20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_core_salsa208.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa208_H 2 | #define crypto_core_salsa208_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa208_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa208_outputbytes(void); 14 | 15 | #define crypto_core_salsa208_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa208_inputbytes(void); 18 | 19 | #define crypto_core_salsa208_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa208_keybytes(void); 22 | 23 | #define crypto_core_salsa208_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa208_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa208(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/neoscrypt.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | void neoscrypt(const char *input, char *output, int profile); 5 | #ifdef __cplusplus 6 | } 7 | #else 8 | #define SCRYPT_BLOCK_SIZE 64 9 | #define SCRYPT_HASH_BLOCK_SIZE 64 10 | #define SCRYPT_HASH_DIGEST_SIZE 32 11 | 12 | typedef uint8_t hash_digest[SCRYPT_HASH_DIGEST_SIZE]; 13 | 14 | #define ROTL32(a,b) (((a) << (b)) | ((a) >> (32 - b))) 15 | #define ROTR32(a,b) (((a) >> (b)) | ((a) << (32 - b))) 16 | 17 | #define U8TO32_BE(p) \ 18 | (((uint32_t)((p)[0]) << 24) | ((uint32_t)((p)[1]) << 16) | \ 19 | ((uint32_t)((p)[2]) << 8) | ((uint32_t)((p)[3]))) 20 | 21 | #define U32TO8_BE(p, v) \ 22 | (p)[0] = (uint8_t)((v) >> 24); (p)[1] = (uint8_t)((v) >> 16); \ 23 | (p)[2] = (uint8_t)((v) >> 8); (p)[3] = (uint8_t)((v) ); 24 | 25 | #define U64TO8_BE(p, v) \ 26 | U32TO8_BE((p), (uint32_t)((v) >> 32)); \ 27 | U32TO8_BE((p) + 4, (uint32_t)((v) )); 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_core_hchacha20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_hchacha20_H 2 | #define crypto_core_hchacha20_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_hchacha20_OUTPUTBYTES 32U 12 | SODIUM_EXPORT 13 | size_t crypto_core_hchacha20_outputbytes(void); 14 | 15 | #define crypto_core_hchacha20_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_hchacha20_inputbytes(void); 18 | 19 | #define crypto_core_hchacha20_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_hchacha20_keybytes(void); 22 | 23 | #define crypto_core_hchacha20_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_hchacha20_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_hchacha20(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_core_salsa2012.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_core_salsa2012_H 2 | #define crypto_core_salsa2012_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define crypto_core_salsa2012_OUTPUTBYTES 64U 12 | SODIUM_EXPORT 13 | size_t crypto_core_salsa2012_outputbytes(void); 14 | 15 | #define crypto_core_salsa2012_INPUTBYTES 16U 16 | SODIUM_EXPORT 17 | size_t crypto_core_salsa2012_inputbytes(void); 18 | 19 | #define crypto_core_salsa2012_KEYBYTES 32U 20 | SODIUM_EXPORT 21 | size_t crypto_core_salsa2012_keybytes(void); 22 | 23 | #define crypto_core_salsa2012_CONSTBYTES 16U 24 | SODIUM_EXPORT 25 | size_t crypto_core_salsa2012_constbytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_core_salsa2012(unsigned char *out, const unsigned char *in, 29 | const unsigned char *k, const unsigned char *c); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/runtime.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_runtime_H 3 | #define sodium_runtime_H 4 | 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | SODIUM_EXPORT 12 | int sodium_runtime_has_neon(void); 13 | 14 | SODIUM_EXPORT 15 | int sodium_runtime_has_sse2(void); 16 | 17 | SODIUM_EXPORT 18 | int sodium_runtime_has_sse3(void); 19 | 20 | SODIUM_EXPORT 21 | int sodium_runtime_has_ssse3(void); 22 | 23 | SODIUM_EXPORT 24 | int sodium_runtime_has_sse41(void); 25 | 26 | SODIUM_EXPORT 27 | int sodium_runtime_has_avx(void); 28 | 29 | SODIUM_EXPORT 30 | int sodium_runtime_has_avx2(void); 31 | 32 | SODIUM_EXPORT 33 | int sodium_runtime_has_pclmul(void); 34 | 35 | SODIUM_EXPORT 36 | int sodium_runtime_has_aesni(void); 37 | 38 | /* ------------------------------------------------------------------------- */ 39 | 40 | int _sodium_runtime_get_cpu_features(void); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/warnings.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(_MSC_VER) 4 | 5 | #define PUSH_WARNINGS __pragma(warning(push)) 6 | #define POP_WARNINGS __pragma(warning(pop)) 7 | #define DISABLE_VS_WARNINGS(w) __pragma(warning(disable: w)) 8 | #define DISABLE_GCC_WARNING(w) 9 | #define DISABLE_CLANG_WARNING(w) 10 | #define DISABLE_GCC_AND_CLANG_WARNING(w) 11 | 12 | #else 13 | 14 | #include 15 | 16 | #define PUSH_WARNINGS _Pragma("GCC diagnostic push") 17 | #define POP_WARNINGS _Pragma("GCC diagnostic pop") 18 | #define DISABLE_VS_WARNINGS(w) 19 | 20 | #if defined(__clang__) 21 | #define DISABLE_GCC_WARNING(w) 22 | #define DISABLE_CLANG_WARNING DISABLE_GCC_AND_CLANG_WARNING 23 | #else 24 | #define DISABLE_GCC_WARNING DISABLE_GCC_AND_CLANG_WARNING 25 | #define DISABLE_CLANG_WARNING(w) 26 | #endif 27 | 28 | #define DISABLE_GCC_AND_CLANG_WARNING(w) _Pragma(BOOST_PP_STRINGIZE(GCC diagnostic ignored BOOST_PP_STRINGIZE(-W##w))) 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/s3.c: -------------------------------------------------------------------------------- 1 | #include "s3.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_skein.h" 8 | #include "sha3/sph_shavite.h" 9 | #include "sha3/sph_simd.h" 10 | 11 | void s3_hash(const char* input, char* output, uint32_t len) 12 | { 13 | sph_shavite512_context ctx_shavite1; 14 | sph_simd512_context ctx_simd1; 15 | sph_skein512_context ctx_skein; 16 | 17 | //these uint512 in the c++ source of the client are backed by an array of uint32 18 | uint32_t hashA[16], hashB[16]; 19 | 20 | sph_shavite512_init (&ctx_shavite1); 21 | sph_shavite512 (&ctx_shavite1, input, 80); 22 | sph_shavite512_close(&ctx_shavite1, hashA); 23 | 24 | sph_simd512_init (&ctx_simd1); 25 | sph_simd512 (&ctx_simd1, hashA, 64); 26 | sph_simd512_close(&ctx_simd1, hashB); 27 | 28 | sph_skein512_init(&ctx_skein); 29 | sph_skein512 (&ctx_skein, hashB, 64); 30 | sph_skein512_close (&ctx_skein, hashA); 31 | 32 | memcpy(output, hashA, 32); 33 | } 34 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_scalarmult.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_scalarmult_H 2 | #define crypto_scalarmult_H 3 | 4 | #include 5 | 6 | #include "crypto_scalarmult_curve25519.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | #define crypto_scalarmult_BYTES crypto_scalarmult_curve25519_BYTES 14 | SODIUM_EXPORT 15 | size_t crypto_scalarmult_bytes(void); 16 | 17 | #define crypto_scalarmult_SCALARBYTES crypto_scalarmult_curve25519_SCALARBYTES 18 | SODIUM_EXPORT 19 | size_t crypto_scalarmult_scalarbytes(void); 20 | 21 | #define crypto_scalarmult_PRIMITIVE "curve25519" 22 | SODIUM_EXPORT 23 | const char *crypto_scalarmult_primitive(void); 24 | 25 | SODIUM_EXPORT 26 | int crypto_scalarmult_base(unsigned char *q, const unsigned char *n); 27 | 28 | SODIUM_EXPORT 29 | int crypto_scalarmult(unsigned char *q, const unsigned char *n, 30 | const unsigned char *p) 31 | __attribute__ ((warn_unused_result)); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | INC_DIRS = -I. -Icontrib/epee/include 3 | CFLAGS = -Wall -c -fPIC -maes -O2 -g $(INC_DIRS) -Wno-strict-aliasing 4 | CXXFLAGS = -Wall -Wno-unused-function -fPIC -fpermissive -std=c++0x -fexceptions -frtti -O2 -g $(INC_DIRS) 5 | LDFLAGS = -shared 6 | LDLIBS = -lboost_system -lboost_date_time 7 | TARGET = libcryptonote.so 8 | 9 | OBJECTS = contrib/epee/src/hex.o \ 10 | common/base58.o crypto/aesb.o crypto/blake256.o crypto/chacha8.o \ 11 | crypto/crypto-ops-data.o crypto/crypto-ops.o crypto/crypto.o crypto/groestl.o crypto/hash-extra-blake.o \ 12 | crypto/hash-extra-groestl.o crypto/hash-extra-jh.o crypto/hash-extra-skein.o crypto/hash.o crypto/jh.o \ 13 | crypto/keccak.o crypto/oaes_lib.o crypto/random.o crypto/skein.o crypto/slow-hash.o crypto/tree-hash.o \ 14 | crypto/slow-hash-lite.o cryptonote_basic/cryptonote_format_utils.o exports.o 15 | 16 | all: $(TARGET) 17 | 18 | $(TARGET): $(OBJECTS) 19 | g++ $(LDFLAGS) -o $@ $^ $(LDLIBS) 20 | 21 | .PHONY: clean 22 | 23 | clean: 24 | find . -name '*.o' -exec rm -r {} \; 25 | rm libcryptonote.so 26 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/net-core-test/net-core-test.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "net-core-test", "net-core-test.csproj", "{23D6F17A-2FA5-4614-812B-864387322994}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {23D6F17A-2FA5-4614-812B-864387322994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {23D6F17A-2FA5-4614-812B-864387322994}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {23D6F17A-2FA5-4614-812B-864387322994}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {23D6F17A-2FA5-4614-812B-864387322994}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/Makefile.MSys2: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | INC_DIRS = -I. -Icontrib/epee/include 3 | CFLAGS = -Wall -c -fPIC -maes -O2 $(INC_DIRS) 4 | CXXFLAGS = -Wall -fPIC -fpermissive -std=c++0x -fexceptions -frtti -O2 $(INC_DIRS) 5 | LDFLAGS = -shared -static-libgcc -static-libstdc++ -static 6 | LDLIBS = -lboost_system-mt -lboost_date_time-mt 7 | TARGET = libcryptonote.dll 8 | 9 | OBJECTS = contrib/epee/src/hex.o \ 10 | common/base58.o crypto/aesb.o crypto/blake256.o crypto/chacha8.o \ 11 | crypto/crypto-ops-data.o crypto/crypto-ops.o crypto/crypto.o crypto/groestl.o crypto/hash-extra-blake.o \ 12 | crypto/hash-extra-groestl.o crypto/hash-extra-jh.o crypto/hash-extra-skein.o crypto/hash.o crypto/jh.o \ 13 | crypto/keccak.o crypto/oaes_lib.o crypto/random.o crypto/skein.o crypto/slow-hash.o crypto/tree-hash.o \ 14 | crypto/slow-hash-lite.o cryptonote_basic/cryptonote_format_utils.o exports.o 15 | 16 | all: $(TARGET) 17 | 18 | $(TARGET): $(OBJECTS) 19 | g++ $(LDFLAGS) -o $@ $^ $(LDLIBS) 20 | 21 | .PHONY: clean 22 | 23 | clean: 24 | find . -name '*.o' -exec rm -r {} \; 25 | rm libcryptonote.dll 26 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_hash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_hash_H 2 | #define crypto_hash_H 3 | 4 | /* 5 | * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 6 | * purposes, you might want to consider crypto_generichash() instead. 7 | * Unlike SHA512, crypto_generichash() is not vulnerable to length 8 | * extension attacks. 9 | */ 10 | 11 | #include 12 | 13 | #include "crypto_hash_sha512.h" 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # ifdef __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_hash_BYTES crypto_hash_sha512_BYTES 24 | SODIUM_EXPORT 25 | size_t crypto_hash_bytes(void); 26 | 27 | SODIUM_EXPORT 28 | int crypto_hash(unsigned char *out, const unsigned char *in, 29 | unsigned long long inlen); 30 | 31 | #define crypto_hash_PRIMITIVE "sha512" 32 | SODIUM_EXPORT 33 | const char *crypto_hash_primitive(void) 34 | __attribute__ ((warn_unused_result)); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_shorthash.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_H 2 | #define crypto_shorthash_H 3 | 4 | #include 5 | 6 | #include "crypto_shorthash_siphash24.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # ifdef __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_shorthash_BYTES crypto_shorthash_siphash24_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_shorthash_bytes(void); 19 | 20 | #define crypto_shorthash_KEYBYTES crypto_shorthash_siphash24_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_shorthash_keybytes(void); 23 | 24 | #define crypto_shorthash_PRIMITIVE "siphash24" 25 | SODIUM_EXPORT 26 | const char *crypto_shorthash_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_shorthash(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | SODIUM_EXPORT 33 | void crypto_shorthash_keygen(unsigned char k[crypto_shorthash_KEYBYTES]); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/readline_buffer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace rdln 10 | { 11 | typedef enum { empty, partial, full } linestatus; 12 | class readline_buffer : public std::stringbuf 13 | { 14 | public: 15 | readline_buffer(); 16 | void start(); 17 | void stop(); 18 | bool is_running() const 19 | { 20 | return m_cout_buf != NULL; 21 | } 22 | linestatus get_line(std::string& line) const; 23 | void set_prompt(const std::string& prompt); 24 | static void add_completion(const std::string& command); 25 | static const std::vector& get_completions(); 26 | 27 | protected: 28 | virtual int sync(); 29 | 30 | private: 31 | std::streambuf* m_cout_buf; 32 | static std::vector& completion_commands(); 33 | }; 34 | 35 | class suspend_readline 36 | { 37 | public: 38 | suspend_readline(); 39 | ~suspend_readline(); 40 | private: 41 | readline_buffer* m_buffer; 42 | bool m_restart; 43 | }; 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/compiler.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of cpp-ethereum. 3 | 4 | cpp-ethereum is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | cpp-ethereum is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with cpp-ethereum. If not, see . 16 | */ 17 | /** @file compiler.h 18 | * @date 2014 19 | */ 20 | #pragma once 21 | 22 | // Visual Studio doesn't support the inline keyword in C mode 23 | #if defined(_MSC_VER) && !defined(__cplusplus) 24 | #define inline __inline 25 | #endif 26 | 27 | // pretend restrict is a standard keyword 28 | #if defined(_MSC_VER) 29 | #define restrict __restrict 30 | #else 31 | #define restrict __restrict__ 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/export.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef sodium_export_H 3 | #define sodium_export_H 4 | 5 | #ifndef __GNUC__ 6 | # ifdef __attribute__ 7 | # undef __attribute__ 8 | # endif 9 | # define __attribute__(a) 10 | #endif 11 | 12 | #ifdef SODIUM_STATIC 13 | # define SODIUM_EXPORT 14 | #else 15 | # if defined(_MSC_VER) 16 | # ifdef SODIUM_DLL_EXPORT 17 | # define SODIUM_EXPORT __declspec(dllexport) 18 | # else 19 | # define SODIUM_EXPORT __declspec(dllimport) 20 | # endif 21 | # else 22 | # if defined(__SUNPRO_C) 23 | # ifndef __GNU_C__ 24 | # define SODIUM_EXPORT __attribute__ (visibility(__global)) 25 | # else 26 | # define SODIUM_EXPORT __attribute__ __global 27 | # endif 28 | # elif defined(_MSG_VER) 29 | # define SODIUM_EXPORT extern __declspec(dllexport) 30 | # else 31 | # define SODIUM_EXPORT __attribute__ ((visibility ("default"))) 32 | # endif 33 | # endif 34 | #endif 35 | 36 | #ifndef CRYPTO_ALIGN 37 | # if defined(__INTEL_COMPILER) || defined(_MSC_VER) 38 | # define CRYPTO_ALIGN(x) __declspec(align(x)) 39 | # else 40 | # define CRYPTO_ALIGN(x) __attribute__ ((aligned(x))) 41 | # endif 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/groestl.c: -------------------------------------------------------------------------------- 1 | #include "groestl.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_groestl.h" 8 | #include "sha256.h" 9 | 10 | void groestl_hash(const char* input, char* output, uint32_t len) 11 | { 12 | char hash1[64]; 13 | char hash2[64]; 14 | 15 | sph_groestl512_context ctx_groestl; 16 | sph_groestl512_init(&ctx_groestl); 17 | sph_groestl512(&ctx_groestl, input, len); 18 | sph_groestl512_close(&ctx_groestl, &hash1); 19 | 20 | sph_groestl512(&ctx_groestl, hash1, 64); 21 | sph_groestl512_close(&ctx_groestl, &hash2); 22 | 23 | memcpy(output, &hash2, 32); 24 | } 25 | 26 | void groestlmyriad_hash(const char* input, char* output, uint32_t len) 27 | { 28 | char temp[64]; 29 | 30 | sph_groestl512_context ctx_groestl; 31 | sph_groestl512_init(&ctx_groestl); 32 | sph_groestl512(&ctx_groestl, input, len); 33 | sph_groestl512_close(&ctx_groestl, &temp); 34 | 35 | SHA256_CTX ctx_sha256; 36 | SHA256_Init(&ctx_sha256); 37 | SHA256_Update(&ctx_sha256, &temp, 64); 38 | SHA256_Final((unsigned char*) output, &ctx_sha256); 39 | } 40 | 41 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CFLAGS = -Wall -c -fPIC -O2 -g -Wno-pointer-sign -Wno-unused-function -Wno-strict-aliasing -Wno-discarded-qualifiers 3 | CXXFLAGS = -Wall -fPIC -fpermissive -O2 -g -Wno-unused-function -Wno-strict-aliasing 4 | LDFLAGS = -shared 5 | LDLIBS = -lsodium 6 | TARGET = libmultihash.so 7 | 8 | OBJECTS = bcrypt.o blake.o c11.o dcrypt.o fresh.o \ 9 | fugue.o groestl.o hefty1.o jh.o keccak.o neoscrypt.o exports.o nist5.o quark.o qubit.o s3.o scryptn.o \ 10 | sha3/aes_helper.o sha3/hamsi.o sha3/hamsi_helper.o sha3/sph_blake.o sha3/sph_bmw.o sha3/sph_cubehash.o \ 11 | sha3/sph_echo.o sha3/sph_fugue.o sha3/sph_groestl.o sha3/sph_hefty1.o sha3/sph_jh.o sha3/sph_keccak.o \ 12 | sha3/sph_luffa.o sha3/sph_shabal.o sha3/sph_shavite.o sha3/sph_simd.o sha3/sph_skein.o sha3/sph_whirlpool.o \ 13 | shavite3.o skein.o x11.o x15.o \ 14 | Lyra2.o Lyra2RE.o Sponge.o \ 15 | equi/endian.o equi/equi.o \ 16 | libethash/internal.o libethash/io.o libethash/io_posix.o libethash/sha3.o 17 | 18 | all: $(TARGET) 19 | 20 | $(TARGET): $(OBJECTS) 21 | g++ $(LDFLAGS) -o $@ $^ $(LDLIBS) 22 | 23 | .PHONY: clean 24 | 25 | clean: 26 | find . -name '*.o' -exec rm -r {} \; 27 | rm libmultihash.so 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | hypepool - Crypto Currency Mining Pool Server Software 4 | Copyright (c) 2013 - 2018 Hüseyin Uslu 5 | https://github.com/bonesoul/hypepool 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_auth.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_auth_H 2 | #define crypto_auth_H 3 | 4 | #include 5 | 6 | #include "crypto_auth_hmacsha512256.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # ifdef __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | #define crypto_auth_BYTES crypto_auth_hmacsha512256_BYTES 17 | SODIUM_EXPORT 18 | size_t crypto_auth_bytes(void); 19 | 20 | #define crypto_auth_KEYBYTES crypto_auth_hmacsha512256_KEYBYTES 21 | SODIUM_EXPORT 22 | size_t crypto_auth_keybytes(void); 23 | 24 | #define crypto_auth_PRIMITIVE "hmacsha512256" 25 | SODIUM_EXPORT 26 | const char *crypto_auth_primitive(void); 27 | 28 | SODIUM_EXPORT 29 | int crypto_auth(unsigned char *out, const unsigned char *in, 30 | unsigned long long inlen, const unsigned char *k); 31 | 32 | SODIUM_EXPORT 33 | int crypto_auth_verify(const unsigned char *h, const unsigned char *in, 34 | unsigned long long inlen, const unsigned char *k) 35 | __attribute__ ((warn_unused_result)); 36 | 37 | SODIUM_EXPORT 38 | void crypto_auth_keygen(unsigned char k[crypto_auth_KEYBYTES]); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_kdf_blake2b.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_kdf_blake2b_H 2 | #define crypto_kdf_blake2b_H 3 | 4 | #include 5 | #include 6 | 7 | #include "crypto_kdf_blake2b.h" 8 | #include "export.h" 9 | 10 | #ifdef __cplusplus 11 | # ifdef __GNUC__ 12 | # pragma GCC diagnostic ignored "-Wlong-long" 13 | # endif 14 | extern "C" { 15 | #endif 16 | 17 | #define crypto_kdf_blake2b_BYTES_MIN 16 18 | SODIUM_EXPORT 19 | size_t crypto_kdf_blake2b_bytes_min(void); 20 | 21 | #define crypto_kdf_blake2b_BYTES_MAX 64 22 | SODIUM_EXPORT 23 | size_t crypto_kdf_blake2b_bytes_max(void); 24 | 25 | #define crypto_kdf_blake2b_CONTEXTBYTES 8 26 | SODIUM_EXPORT 27 | size_t crypto_kdf_blake2b_contextbytes(void); 28 | 29 | #define crypto_kdf_blake2b_KEYBYTES 32 30 | SODIUM_EXPORT 31 | size_t crypto_kdf_blake2b_keybytes(void); 32 | 33 | SODIUM_EXPORT 34 | int crypto_kdf_blake2b_derive_from_key(unsigned char *subkey, size_t subkey_len, 35 | uint64_t subkey_id, 36 | const char ctx[crypto_kdf_blake2b_CONTEXTBYTES], 37 | const unsigned char key[crypto_kdf_blake2b_KEYBYTES]); 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/sha3_cryptopp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of ethash. 3 | 4 | ethash is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | ethash is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with ethash. If not, see . 16 | */ 17 | 18 | /** @file sha3.cpp 19 | * @author Tim Hughes 20 | * @date 2015 21 | */ 22 | #include 23 | #include 24 | 25 | extern "C" { 26 | struct ethash_h256; 27 | typedef struct ethash_h256 ethash_h256_t; 28 | void SHA3_256(ethash_h256_t const* ret, uint8_t const* data, size_t size) 29 | { 30 | CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); 31 | } 32 | 33 | void SHA3_512(uint8_t* const ret, uint8_t const* data, size_t size) 34 | { 35 | CryptoPP::SHA3_512().CalculateDigest(ret, data, size); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Benchmarks/Hypepool.Benchmarks.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 2.0.5 7 | 0.0.1 8 | 0.0.1.0 9 | 0.0.1.0 10 | x64;x86 11 | 12 | 13 | 14 | latest 15 | 16 | 17 | 18 | latest 19 | 20 | 21 | 22 | latest 23 | 24 | 25 | 26 | latest 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/scryptjane.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRYPT_JANE_H 2 | #define SCRYPT_JANE_H 3 | 4 | #include 5 | 6 | #define SCRYPT_KECCAK512 7 | #define SCRYPT_CHACHA 8 | #define SCRYPT_CHOOSE_COMPILETIME 9 | 10 | /* 11 | Nfactor: Increases CPU & Memory Hardness 12 | N = (1 << (Nfactor + 1)): How many times to mix a chunk and how many temporary chunks are used 13 | 14 | rfactor: Increases Memory Hardness 15 | r = (1 << rfactor): How large a chunk is 16 | 17 | pfactor: Increases CPU Hardness 18 | p = (1 << pfactor): Number of times to mix the main chunk 19 | 20 | A block is the basic mixing unit (salsa/chacha block = 64 bytes) 21 | A chunk is (2 * r) blocks 22 | 23 | ~Memory used = (N + 2) * ((2 * r) * block size) 24 | */ 25 | 26 | #include 27 | 28 | typedef void (*scrypt_fatal_errorfn)(const char *msg); 29 | void scrypt_set_fatal_error(scrypt_fatal_errorfn fn); 30 | 31 | void scrypt(const unsigned char *password, size_t password_len, const unsigned char *salt, size_t salt_len, unsigned char Nfactor, unsigned char rfactor, unsigned char pfactor, unsigned char *out, size_t bytes); 32 | 33 | unsigned char GetNfactorJane(int nTimestamp, int nChainStartTime, int nMin, int nMax); 34 | void scryptjane_hash(const void* input, size_t inputlen, uint32_t *res, unsigned char Nfactor); 35 | 36 | #endif /* SCRYPT_JANE_H */ 37 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/util_win32.c: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of cpp-ethereum. 3 | 4 | cpp-ethereum is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | cpp-ethereum is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with cpp-ethereum. If not, see . 16 | */ 17 | /** @file util.c 18 | * @author Tim Hughes 19 | * @date 2015 20 | */ 21 | #include 22 | #include 23 | #include "util.h" 24 | 25 | 26 | // foward declare without all of Windows.h 27 | __declspec(dllimport) void __stdcall OutputDebugStringA(char const* lpOutputString); 28 | 29 | void debugf(char const* str, ...) 30 | { 31 | va_list args; 32 | va_start(args, str); 33 | 34 | char buf[1<<16]; 35 | _vsnprintf_s(buf, sizeof(buf), sizeof(buf), str, args); 36 | buf[sizeof(buf)-1] = '\0'; 37 | OutputDebugStringA(buf); 38 | } 39 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/fresh.c: -------------------------------------------------------------------------------- 1 | #include "fresh.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_shavite.h" 8 | #include "sha3/sph_simd.h" 9 | #include "sha3/sph_echo.h" 10 | 11 | void fresh_hash(const char* input, char* output, uint32_t len) 12 | { 13 | sph_shavite512_context ctx_shavite1; 14 | sph_simd512_context ctx_simd1; 15 | sph_echo512_context ctx_echo1; 16 | 17 | //these uint512 in the c++ source of the client are backed by an array of uint32 18 | uint32_t hashA[16], hashB[16]; 19 | 20 | sph_shavite512_init (&ctx_shavite1); 21 | sph_shavite512 (&ctx_shavite1, input, len); 22 | sph_shavite512_close(&ctx_shavite1, hashA); 23 | 24 | sph_simd512_init (&ctx_simd1); 25 | sph_simd512 (&ctx_simd1, hashA, 64); 26 | sph_simd512_close(&ctx_simd1, hashB); 27 | 28 | sph_shavite512_init (&ctx_shavite1); 29 | sph_shavite512 (&ctx_shavite1, hashB, 64); 30 | sph_shavite512_close(&ctx_shavite1, hashA); 31 | 32 | sph_simd512_init (&ctx_simd1); 33 | sph_simd512 (&ctx_simd1, hashA, 64); 34 | sph_simd512_close(&ctx_simd1, hashB); 35 | 36 | sph_echo512_init (&ctx_echo1); 37 | sph_echo512 (&ctx_echo1, hashB, 64); 38 | sph_echo512_close(&ctx_echo1, hashA); 39 | 40 | memcpy(output, hashA, 32); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of ethash. 3 | 4 | ethash is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | ethash is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with ethash. If not, see . 16 | */ 17 | /** @file util.h 18 | * @author Tim Hughes 19 | * @date 2015 20 | */ 21 | #pragma once 22 | #include 23 | #include "compiler.h" 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #ifdef _MSC_VER 30 | void debugf(char const* str, ...); 31 | #else 32 | #define debugf printf 33 | #endif 34 | 35 | static inline uint32_t min_u32(uint32_t a, uint32_t b) 36 | { 37 | return a < b ? a : b; 38 | } 39 | 40 | static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) 41 | { 42 | return x < min_ ? min_ : (x > max_ ? max_ : x); 43 | } 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Hypepool.Monero.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | Hypepool.Monero 7 | Hypepool.Monero 8 | x64;x86 9 | 10 | 11 | 12 | latest 13 | 14 | 15 | 16 | latest 17 | 18 | 19 | 20 | latest 21 | 22 | 23 | 24 | latest 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_shorthash_siphash24.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_shorthash_siphash24_H 2 | #define crypto_shorthash_siphash24_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | # ifdef __GNUC__ 9 | # pragma GCC diagnostic ignored "-Wlong-long" 10 | # endif 11 | extern "C" { 12 | #endif 13 | 14 | /* -- 64-bit output -- */ 15 | 16 | #define crypto_shorthash_siphash24_BYTES 8U 17 | SODIUM_EXPORT 18 | size_t crypto_shorthash_siphash24_bytes(void); 19 | 20 | #define crypto_shorthash_siphash24_KEYBYTES 16U 21 | SODIUM_EXPORT 22 | size_t crypto_shorthash_siphash24_keybytes(void); 23 | 24 | SODIUM_EXPORT 25 | int crypto_shorthash_siphash24(unsigned char *out, const unsigned char *in, 26 | unsigned long long inlen, const unsigned char *k); 27 | 28 | #ifndef SODIUM_LIBRARY_MINIMAL 29 | /* -- 128-bit output -- */ 30 | 31 | #define crypto_shorthash_siphashx24_BYTES 16U 32 | SODIUM_EXPORT 33 | size_t crypto_shorthash_siphashx24_bytes(void); 34 | 35 | #define crypto_shorthash_siphashx24_KEYBYTES 16U 36 | SODIUM_EXPORT 37 | size_t crypto_shorthash_siphashx24_keybytes(void); 38 | 39 | SODIUM_EXPORT 40 | int crypto_shorthash_siphashx24(unsigned char *out, const unsigned char *in, 41 | unsigned long long inlen, const unsigned char *k); 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/equi/equi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 abc at openwall dot com 3 | * Copyright (c) 2016 Jack Grigg 4 | * Copyright (c) 2016 The Zcash developers 5 | * 6 | * Distributed under the MIT software license, see the accompanying 7 | * file COPYING or http://www.opensource.org/licenses/mit-license.php. 8 | * 9 | * Port to C of C++ implementation of the Equihash Proof-of-Work 10 | * algorithm from zcashd. 11 | */ 12 | 13 | #ifndef EQUI_H 14 | #define EQUI_H 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include "endian.h" 29 | 30 | static void digestInit(crypto_generichash_blake2b_state *S, const int n, const int k); 31 | 32 | static void expandArray(const unsigned char *in, const size_t in_len, 33 | unsigned char *out, const size_t out_len, 34 | const size_t bit_len, const size_t byte_pad); 35 | 36 | static int isZero(const uint8_t *hash, size_t len); 37 | 38 | static void generateHash(crypto_generichash_blake2b_state *S, const uint32_t g, uint8_t *hash, const size_t hashLen); 39 | 40 | // hdr -> header including nonce (140 bytes) 41 | // soln -> equihash solution (excluding 3 bytes with size, so 1344 bytes length) 42 | bool verifyEH(const char *hdr, const char *soln); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/fnv.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of cpp-ethereum. 3 | 4 | cpp-ethereum is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | cpp-ethereum is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with cpp-ethereum. If not, see . 16 | */ 17 | /** @file fnv.h 18 | * @author Matthew Wampler-Doty 19 | * @date 2015 20 | */ 21 | 22 | #pragma once 23 | #include 24 | #include "compiler.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #define FNV_PRIME 0x01000193 31 | 32 | /* The FNV-1 spec multiplies the prime with the input one byte (octet) in turn. 33 | We instead multiply it with the full 32-bit input. 34 | This gives a different result compared to a canonical FNV-1 implementation. 35 | */ 36 | static inline uint32_t fnv_hash(uint32_t const x, uint32_t const y) 37 | { 38 | return x * FNV_PRIME ^ y; 39 | } 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/nist5.c: -------------------------------------------------------------------------------- 1 | #include "nist5.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "sha3/sph_blake.h" 8 | #include "sha3/sph_groestl.h" 9 | #include "sha3/sph_jh.h" 10 | #include "sha3/sph_keccak.h" 11 | #include "sha3/sph_skein.h" 12 | 13 | 14 | void nist5_hash(const char* input, char* output, uint32_t len) 15 | { 16 | sph_blake512_context ctx_blake; 17 | sph_groestl512_context ctx_groestl; 18 | sph_skein512_context ctx_skein; 19 | sph_jh512_context ctx_jh; 20 | sph_keccak512_context ctx_keccak; 21 | 22 | //these uint512 in the c++ source of the client are backed by an array of uint32 23 | uint32_t hash[16]; 24 | 25 | sph_blake512_init(&ctx_blake); 26 | sph_blake512 (&ctx_blake, input, len); 27 | sph_blake512_close (&ctx_blake, hash); 28 | 29 | sph_groestl512_init(&ctx_groestl); 30 | sph_groestl512 (&ctx_groestl, hash, 64); 31 | sph_groestl512_close(&ctx_groestl, hash); 32 | 33 | sph_jh512_init(&ctx_jh); 34 | sph_jh512 (&ctx_jh, hash, 64); 35 | sph_jh512_close(&ctx_jh, hash); 36 | 37 | sph_keccak512_init(&ctx_keccak); 38 | sph_keccak512 (&ctx_keccak, hash, 64); 39 | sph_keccak512_close(&ctx_keccak, hash); 40 | 41 | sph_skein512_init(&ctx_skein); 42 | sph_skein512 (&ctx_skein, hash, 64); 43 | sph_skein512_close (&ctx_skein, hash); 44 | 45 | memcpy(output, hash, 32); 46 | } -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_kdf.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_kdf_H 2 | #define crypto_kdf_H 3 | 4 | #include 5 | #include 6 | 7 | #include "crypto_kdf_blake2b.h" 8 | #include "export.h" 9 | 10 | #ifdef __cplusplus 11 | # ifdef __GNUC__ 12 | # pragma GCC diagnostic ignored "-Wlong-long" 13 | # endif 14 | extern "C" { 15 | #endif 16 | 17 | #define crypto_kdf_BYTES_MIN crypto_kdf_blake2b_BYTES_MIN 18 | SODIUM_EXPORT 19 | size_t crypto_kdf_bytes_min(void); 20 | 21 | #define crypto_kdf_BYTES_MAX crypto_kdf_blake2b_BYTES_MAX 22 | SODIUM_EXPORT 23 | size_t crypto_kdf_bytes_max(void); 24 | 25 | #define crypto_kdf_CONTEXTBYTES crypto_kdf_blake2b_CONTEXTBYTES 26 | SODIUM_EXPORT 27 | size_t crypto_kdf_contextbytes(void); 28 | 29 | #define crypto_kdf_KEYBYTES crypto_kdf_blake2b_KEYBYTES 30 | SODIUM_EXPORT 31 | size_t crypto_kdf_keybytes(void); 32 | 33 | #define crypto_kdf_PRIMITIVE "blake2b" 34 | SODIUM_EXPORT 35 | const char *crypto_kdf_primitive(void) 36 | __attribute__ ((warn_unused_result)); 37 | 38 | SODIUM_EXPORT 39 | int crypto_kdf_derive_from_key(unsigned char *subkey, size_t subkey_len, 40 | uint64_t subkey_id, 41 | const char ctx[crypto_kdf_CONTEXTBYTES], 42 | const unsigned char key[crypto_kdf_KEYBYTES]); 43 | 44 | SODIUM_EXPORT 45 | void crypto_kdf_keygen(unsigned char k[crypto_kdf_KEYBYTES]); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Shares/IShare.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | namespace Hypepool.Common.Shares 27 | { 28 | public interface IShare 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Mining/Jobs/IJob.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | namespace Hypepool.Common.Mining.Jobs 28 | { 29 | public interface IJob 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Shares/ShareBase.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | namespace Hypepool.Common.Shares 27 | { 28 | public class ShareBase : IShare 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream_salsa208.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_salsa208_H 2 | #define crypto_stream_salsa208_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | #include "export.h" 14 | 15 | #ifdef __cplusplus 16 | # ifdef __GNUC__ 17 | # pragma GCC diagnostic ignored "-Wlong-long" 18 | # endif 19 | extern "C" { 20 | #endif 21 | 22 | #define crypto_stream_salsa208_KEYBYTES 32U 23 | SODIUM_EXPORT 24 | size_t crypto_stream_salsa208_keybytes(void); 25 | 26 | #define crypto_stream_salsa208_NONCEBYTES 8U 27 | SODIUM_EXPORT 28 | size_t crypto_stream_salsa208_noncebytes(void); 29 | 30 | SODIUM_EXPORT 31 | int crypto_stream_salsa208(unsigned char *c, unsigned long long clen, 32 | const unsigned char *n, const unsigned char *k); 33 | 34 | SODIUM_EXPORT 35 | int crypto_stream_salsa208_xor(unsigned char *c, const unsigned char *m, 36 | unsigned long long mlen, const unsigned char *n, 37 | const unsigned char *k); 38 | 39 | SODIUM_EXPORT 40 | void crypto_stream_salsa208_keygen(unsigned char k[crypto_stream_salsa208_KEYBYTES]); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Hypepool.Common.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | x64;x86 7 | true 8 | 9 | 10 | 11 | true 12 | latest 13 | 14 | 15 | 16 | true 17 | latest 18 | 19 | 20 | 21 | true 22 | latest 23 | 24 | 25 | 26 | true 27 | latest 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Mining/Jobs/IWorkerJob.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | namespace Hypepool.Common.Mining.Jobs 28 | { 29 | public interface IWorkerJob 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Utils/Logging/ILogManager.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | namespace Hypepool.Core.Utils.Logging 28 | { 29 | public interface ILogManager 30 | { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libmultihash.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26720.2 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmultihash", "libmultihash.vcxproj", "{2DE74E14-BF6D-4046-951B-8EBC8A1BA009}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x64.ActiveCfg = Debug|x64 17 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x64.Build.0 = Debug|x64 18 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x86.Build.0 = Debug|Win32 20 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x64.ActiveCfg = Release|x64 21 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x64.Build.0 = Release|x64 22 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x86.ActiveCfg = Release|Win32 23 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {DDE0FE54-030A-4DFD-98A1-952779FB461F} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream_salsa2012.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_salsa2012_H 2 | #define crypto_stream_salsa2012_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | #include "export.h" 14 | 15 | #ifdef __cplusplus 16 | # ifdef __GNUC__ 17 | # pragma GCC diagnostic ignored "-Wlong-long" 18 | # endif 19 | extern "C" { 20 | #endif 21 | 22 | #define crypto_stream_salsa2012_KEYBYTES 32U 23 | SODIUM_EXPORT 24 | size_t crypto_stream_salsa2012_keybytes(void); 25 | 26 | #define crypto_stream_salsa2012_NONCEBYTES 8U 27 | SODIUM_EXPORT 28 | size_t crypto_stream_salsa2012_noncebytes(void); 29 | 30 | SODIUM_EXPORT 31 | int crypto_stream_salsa2012(unsigned char *c, unsigned long long clen, 32 | const unsigned char *n, const unsigned char *k); 33 | 34 | SODIUM_EXPORT 35 | int crypto_stream_salsa2012_xor(unsigned char *c, const unsigned char *m, 36 | unsigned long long mlen, const unsigned char *n, 37 | const unsigned char *k); 38 | 39 | SODIUM_EXPORT 40 | void crypto_stream_salsa2012_keygen(unsigned char k[crypto_stream_salsa2012_KEYBYTES]); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/libcryptonote.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26720.2 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcryptonote", "libcryptonote.vcxproj", "{2DE74E14-BF6D-4046-951B-8EBC8A1BA009}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x64.ActiveCfg = Debug|x64 17 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x64.Build.0 = Debug|x64 18 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Debug|x86.Build.0 = Debug|Win32 20 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x64.ActiveCfg = Release|x64 21 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x64.Build.0 = Release|x64 22 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x86.ActiveCfg = Release|Win32 23 | {2DE74E14-BF6D-4046-951B-8EBC8A1BA009}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {DDE0FE54-030A-4DFD-98A1-952779FB461F} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/qubit.c: -------------------------------------------------------------------------------- 1 | #include "qubit.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "sha3/sph_cubehash.h" 7 | #include "sha3/sph_luffa.h" 8 | #include "sha3/sph_shavite.h" 9 | #include "sha3/sph_simd.h" 10 | #include "sha3/sph_echo.h" 11 | 12 | void qubit_hash(const char* input, char* output, uint32_t len) 13 | { 14 | sph_luffa512_context ctx_luffa; 15 | sph_cubehash512_context ctx_cubehash; 16 | sph_shavite512_context ctx_shavite; 17 | sph_simd512_context ctx_simd; 18 | sph_echo512_context ctx_echo; 19 | 20 | char hash1[64]; 21 | char hash2[64]; 22 | 23 | sph_luffa512_init(&ctx_luffa); 24 | sph_luffa512(&ctx_luffa, (const void*) input, len); 25 | sph_luffa512_close(&ctx_luffa, (void*) &hash1); // 1 26 | 27 | sph_cubehash512_init(&ctx_cubehash); 28 | sph_cubehash512(&ctx_cubehash, (const void*) &hash1, 64); // 1 29 | sph_cubehash512_close(&ctx_cubehash, (void*) &hash2); // 2 30 | 31 | sph_shavite512_init(&ctx_shavite); 32 | sph_shavite512(&ctx_shavite, (const void*) &hash2, 64); // 3 33 | sph_shavite512_close(&ctx_shavite, (void*) &hash1); // 4 34 | 35 | sph_simd512_init(&ctx_simd); 36 | sph_simd512(&ctx_simd, (const void*) &hash1, 64); // 4 37 | sph_simd512_close(&ctx_simd, (void*) &hash2); // 5 38 | 39 | sph_echo512_init(&ctx_echo); 40 | sph_echo512(&ctx_echo, (const void*) &hash2, 64); // 5 41 | sph_echo512_close(&ctx_echo, (void*) &hash1); // 6 42 | 43 | memcpy(output, &hash1, 32); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/MoneroShare.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Common.Shares; 28 | 29 | namespace Hypepool.Monero 30 | { 31 | public class MoneroShare : ShareBase 32 | { 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/libethash/mmap.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of ethash. 3 | 4 | ethash is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | ethash is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with ethash. If not, see . 16 | */ 17 | /** @file mmap.h 18 | * @author Lefteris Karapetsas 19 | * @date 2015 20 | */ 21 | #pragma once 22 | #if defined(__MINGW32__) || defined(_WIN32) 23 | #include 24 | 25 | #define PROT_READ 0x1 26 | #define PROT_WRITE 0x2 27 | /* This flag is only available in WinXP+ */ 28 | #ifdef FILE_MAP_EXECUTE 29 | #define PROT_EXEC 0x4 30 | #else 31 | #define PROT_EXEC 0x0 32 | #define FILE_MAP_EXECUTE 0 33 | #endif 34 | 35 | #define MAP_SHARED 0x01 36 | #define MAP_PRIVATE 0x02 37 | #define MAP_ANONYMOUS 0x20 38 | #define MAP_ANON MAP_ANONYMOUS 39 | #define MAP_FAILED ((void *) -1) 40 | 41 | void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t offset); 42 | void munmap(void* addr, size_t length); 43 | #else // posix, yay! ^_^ 44 | #include 45 | #endif 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Daemon/Responses/GetAddressResponse.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | namespace Hypepool.Monero.Daemon.Responses 28 | { 29 | public class GetAddressResponse 30 | { 31 | public string Address { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Stratum/Responses/MoneroResponseBase.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | namespace Hypepool.Monero.Stratum.Responses 28 | { 29 | public class MoneroResponseBase 30 | { 31 | public string Status { get; set; } = "OK"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | // 2 | // hypepool 3 | // Copyright (C) 2013 - 2017, Int6ware - http://www.int6ware.com 4 | // This file is part of hypepool project. Unauthorized copying of this file, via any medium is strictly prohibited. 5 | // hypepool or its components/sources can not be copied and/or distributed without the express permission of Int6ware. 6 | // 7 | 'use strict'; 8 | 9 | module.exports = function (grunt) { 10 | //require('time-grunt')(grunt); 11 | 12 | grunt.initConfig({ 13 | vcpkg_dir: 'build\\vcpkg', // vcpkg dir. 14 | deps_dir: 'deps\\windows', // deps dir. 15 | vcpkg: 'build\\vcpkg\\vcpkg', // vcpkg executable. 16 | shell: { 17 | clone_vcpkg: { 18 | command: 'git clone https://github.com/Microsoft/vcpkg.git <%= vcpkg_dir %> && git pull', 19 | options: { 20 | failOnError: false 21 | } 22 | }, 23 | install_vcpkg: '<%= vcpkg_dir %>\\bootstrap-vcpkg.bat', 24 | install_packages: '<%= vcpkg %> install boost', 25 | cook_libboost: '<%= vcpkg %> export --nuget --nuget-id=libboost --nuget-version=1.66.0 boost' 26 | } 27 | }); 28 | 29 | // load all plugins. 30 | require('load-grunt-tasks')(grunt); 31 | 32 | // task steps. 33 | grunt.registerTask('vcpkg', ['shell:clone_vcpkg', 'shell:install_vcpkg']); 34 | grunt.registerTask('cook_windows_deps', ['shell:install_packages', 'shell:cook_libboost']); 35 | 36 | // build tasks. 37 | grunt.registerTask('cook-deps', ['vcpkg', 'cook_windows_deps']); 38 | grunt.registerTask('build', []); 39 | 40 | // default task. 41 | grunt.registerTask('default', ['build']); 42 | }; 43 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_H 2 | #define crypto_stream_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | 14 | #include "crypto_stream_xsalsa20.h" 15 | #include "export.h" 16 | 17 | #ifdef __cplusplus 18 | # ifdef __GNUC__ 19 | # pragma GCC diagnostic ignored "-Wlong-long" 20 | # endif 21 | extern "C" { 22 | #endif 23 | 24 | #define crypto_stream_KEYBYTES crypto_stream_xsalsa20_KEYBYTES 25 | SODIUM_EXPORT 26 | size_t crypto_stream_keybytes(void); 27 | 28 | #define crypto_stream_NONCEBYTES crypto_stream_xsalsa20_NONCEBYTES 29 | SODIUM_EXPORT 30 | size_t crypto_stream_noncebytes(void); 31 | 32 | #define crypto_stream_PRIMITIVE "xsalsa20" 33 | SODIUM_EXPORT 34 | const char *crypto_stream_primitive(void); 35 | 36 | SODIUM_EXPORT 37 | int crypto_stream(unsigned char *c, unsigned long long clen, 38 | const unsigned char *n, const unsigned char *k); 39 | 40 | SODIUM_EXPORT 41 | int crypto_stream_xor(unsigned char *c, const unsigned char *m, 42 | unsigned long long mlen, const unsigned char *n, 43 | const unsigned char *k); 44 | 45 | SODIUM_EXPORT 46 | void crypto_stream_keygen(unsigned char k[crypto_stream_KEYBYTES]); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Bootstrap/IBootstrapper.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Stashbox; 28 | 29 | namespace Hypepool.Core.Internals.Bootstrap 30 | { 31 | public interface IBootstrapper 32 | { 33 | StashboxContainer Container { get; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Factories/Server/IServerFactory.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using Hypepool.Common.Stratum; 27 | 28 | namespace Hypepool.Common.Factories.Server 29 | { 30 | public interface IServerFactory 31 | { 32 | IStratumServer GetStratumServer(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Requirements 2 | 3 | * Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion. 4 | * All new code requires tests to ensure against regressions 5 | 6 | ### Description of the Change 7 | 8 | 13 | 14 | ### Alternate Designs 15 | 16 | 17 | 18 | ### Benefits 19 | 20 | 21 | 22 | ### Possible Drawbacks 23 | 24 | 25 | 26 | ### Verification Process 27 | 28 | 39 | 40 | ### Applicable Issues 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Stratum/StratumConstants.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System.Text; 28 | 29 | namespace Hypepool.Core.Stratum 30 | { 31 | public static class StratumConstants 32 | { 33 | public static readonly Encoding Encoding = new UTF8Encoding(false); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_hash_sha256.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_hash_sha256_H 2 | #define crypto_hash_sha256_H 3 | 4 | /* 5 | * WARNING: Unless you absolutely need to use SHA256 for interoperatibility, 6 | * purposes, you might want to consider crypto_generichash() instead. 7 | * Unlike SHA256, crypto_generichash() is not vulnerable to length 8 | * extension attacks. 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "export.h" 16 | 17 | #ifdef __cplusplus 18 | # ifdef __GNUC__ 19 | # pragma GCC diagnostic ignored "-Wlong-long" 20 | # endif 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct crypto_hash_sha256_state { 25 | uint32_t state[8]; 26 | uint64_t count; 27 | uint8_t buf[64]; 28 | } crypto_hash_sha256_state; 29 | 30 | SODIUM_EXPORT 31 | size_t crypto_hash_sha256_statebytes(void); 32 | 33 | #define crypto_hash_sha256_BYTES 32U 34 | SODIUM_EXPORT 35 | size_t crypto_hash_sha256_bytes(void); 36 | 37 | SODIUM_EXPORT 38 | int crypto_hash_sha256(unsigned char *out, const unsigned char *in, 39 | unsigned long long inlen); 40 | 41 | SODIUM_EXPORT 42 | int crypto_hash_sha256_init(crypto_hash_sha256_state *state); 43 | 44 | SODIUM_EXPORT 45 | int crypto_hash_sha256_update(crypto_hash_sha256_state *state, 46 | const unsigned char *in, 47 | unsigned long long inlen); 48 | 49 | SODIUM_EXPORT 50 | int crypto_hash_sha256_final(crypto_hash_sha256_state *state, 51 | unsigned char *out); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_hash_sha512.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_hash_sha512_H 2 | #define crypto_hash_sha512_H 3 | 4 | /* 5 | * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, 6 | * purposes, you might want to consider crypto_generichash() instead. 7 | * Unlike SHA512, crypto_generichash() is not vulnerable to length 8 | * extension attacks. 9 | */ 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "export.h" 16 | 17 | #ifdef __cplusplus 18 | # ifdef __GNUC__ 19 | # pragma GCC diagnostic ignored "-Wlong-long" 20 | # endif 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct crypto_hash_sha512_state { 25 | uint64_t state[8]; 26 | uint64_t count[2]; 27 | uint8_t buf[128]; 28 | } crypto_hash_sha512_state; 29 | 30 | SODIUM_EXPORT 31 | size_t crypto_hash_sha512_statebytes(void); 32 | 33 | #define crypto_hash_sha512_BYTES 64U 34 | SODIUM_EXPORT 35 | size_t crypto_hash_sha512_bytes(void); 36 | 37 | SODIUM_EXPORT 38 | int crypto_hash_sha512(unsigned char *out, const unsigned char *in, 39 | unsigned long long inlen); 40 | 41 | SODIUM_EXPORT 42 | int crypto_hash_sha512_init(crypto_hash_sha512_state *state); 43 | 44 | SODIUM_EXPORT 45 | int crypto_hash_sha512_update(crypto_hash_sha512_state *state, 46 | const unsigned char *in, 47 | unsigned long long inlen); 48 | 49 | SODIUM_EXPORT 50 | int crypto_hash_sha512_final(crypto_hash_sha512_state *state, 51 | unsigned char *out); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Styleguides 2 | 3 | ### Git Commit Messages 4 | 5 | * Use the present tense ("Add feature" not "Added feature") 6 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 7 | * Limit the first line to 72 characters or less 8 | * Reference issues and pull requests liberally after the first line 9 | * When only changing documentation, include `[ci skip]` in the commit title 10 | * Consider starting the commit message with an applicable emoji: 11 | * :tada: `:tada:` when bumping version 12 | * :sparkles: `:sparkles:` when introducing new functionality 13 | * :rocket: `:rocket:` when improving performance 14 | * :wrench: `:wrench:` when working on tooling 15 | * :poop: `:poop:` when depricating stuff 16 | * :construction: `:construction:` when workin in progress 17 | * :art: `:art:` when improving the format/structure of the code 18 | * :racehorse: `:racehorse:` when improving performance 19 | * :non-potable_water: `:non-potable_water:` when plugging memory leaks 20 | * :books: `:books:` when writing docs 21 | * :penguin: `:penguin:` when fixing something on Linux 22 | * :apple: `:apple:` when fixing something on macOS 23 | * :checkered_flag: `:checkered_flag:` when fixing something on Windows 24 | * :bug: `:bug:` when fixing a bug 25 | * :fire: `:fire:` when removing code or files 26 | * :green_heart: `:green_heart:` when fixing the CI build 27 | * :white_check_mark: `:white_check_mark:` when adding tests 28 | * :lock: `:lock:` when dealing with security 29 | * :arrow_up: `:arrow_up:` when upgrading dependencies 30 | * :arrow_down: `:arrow_down:` when downgrading dependencies 31 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Daemon/DaemonResponse.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Common.JsonRpc; 28 | 29 | namespace Hypepool.Common.Daemon 30 | { 31 | public class DaemonResponse 32 | { 33 | public JsonRpcException Error { get; set; } 34 | 35 | public T Response { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Factories/Pool/IPoolFactory.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Common.Pools; 28 | 29 | namespace Hypepool.Core.Internals.Factories.Pool 30 | { 31 | public interface IPoolFactory 32 | { 33 | IPool GetPool(string name); 34 | 35 | IPoolContext GetPoolContext(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Registries/IRegistry.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | namespace Hypepool.Core.Internals.Registries 27 | { 28 | public interface IRegistry 29 | { 30 | /// 31 | /// Runs the registery so it can register it's contents. 32 | /// 33 | void Run(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Mining/Jobs/IJobManager.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System.Threading.Tasks; 28 | using Hypepool.Common.Pools; 29 | 30 | namespace Hypepool.Common.Mining.Jobs 31 | { 32 | public interface IJobManager 33 | { 34 | Task Start(); 35 | 36 | void Configure(IPoolContext poolContext); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Core/IEngine.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using System.Collections.Generic; 27 | using System.Threading.Tasks; 28 | using Hypepool.Common.Pools; 29 | 30 | namespace Hypepool.Core.Core 31 | { 32 | public interface IEngine 33 | { 34 | IReadOnlyList Pools { get; } 35 | 36 | Task Start(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Benchmarks/Program.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using BenchmarkDotNet.Running; 28 | using Hypepool.Benchmarks.Utils.Helpers.Time; 29 | 30 | namespace Hypepool.Benchmarks 31 | { 32 | class Program 33 | { 34 | static void Main(string[] args) 35 | { 36 | var summary = BenchmarkRunner.Run(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/net-core-test/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace net_core_test 7 | { 8 | unsafe class Program 9 | { 10 | [DllImport("libmultihash", EntryPoint = "scrypt_export", CallingConvention = CallingConvention.Cdecl)] 11 | public static extern int scrypt(byte* input, byte* output, uint n, uint r, uint inputLength); 12 | 13 | public static string ToHexString(IEnumerable byteArray) 14 | { 15 | return ToHexString(byteArray.ToArray()); 16 | } 17 | 18 | public static string ToHexString(byte[] byteArray) 19 | { 20 | return byteArray.Aggregate("", (current, b) => current + b.ToString("x2")); 21 | } 22 | 23 | public static byte[] HexToByteArray(string str) 24 | { 25 | byte[] arr = new byte[str.Length >> 1]; 26 | 27 | for (int i = 0; i < (str.Length >> 1); ++i) 28 | { 29 | arr[i] = (byte)((GetHexVal(str[i << 1]) << 4) + (GetHexVal(str[(i << 1) + 1]))); 30 | } 31 | 32 | return arr; 33 | } 34 | 35 | private static int GetHexVal(char hex) 36 | { 37 | int val = (int)hex; 38 | return val - (val < 58 ? 48 : (val < 97 ? 55 : 87)); 39 | } 40 | 41 | static void Main(string[] args) 42 | { 43 | var data = HexToByteArray("{A16A29DF-C291-482A-A739-A105A2F240C9}"); 44 | var result = new byte[32]; 45 | 46 | fixed (byte* input = data) 47 | { 48 | fixed (byte* output = result) 49 | { 50 | scrypt(input, output, 1024, 1, (uint)data.Length); 51 | } 52 | 53 | Console.WriteLine(ToHexString(result)); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/JsonRpc/JsonSerializerSettings.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | using Newtonsoft.Json.Serialization; 29 | 30 | namespace Hypepool.Common.JsonRpc 31 | { 32 | public class Globals 33 | { 34 | public static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings 35 | { 36 | ContractResolver = new CamelCasePropertyNamesContractResolver() 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Stratum/StratumError.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | namespace Hypepool.Common.Stratum 27 | { 28 | /// 29 | /// Stratum errors. 30 | /// 31 | public enum StratumError 32 | { 33 | MinusOne = -1, 34 | Other = 20, 35 | JobNotFound = 21, // stale 36 | DuplicateShare = 22, 37 | LowDifficultyShare = 23, 38 | UnauthorizedWorker = 24, 39 | NotSubscribed = 25 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Pools/PoolStartupAbortedException.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System; 28 | 29 | namespace Hypepool.Common.Pools 30 | { 31 | /// 32 | /// An exception that occured in pool startup that it's fatal for the pool. 33 | /// 34 | public class PoolStartupAbortedException : Exception 35 | { 36 | public PoolStartupAbortedException(string msg) 37 | : base(msg) 38 | { 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream_salsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_salsa20_H 2 | #define crypto_stream_salsa20_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | #include 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # ifdef __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_stream_salsa20_KEYBYTES 32U 24 | SODIUM_EXPORT 25 | size_t crypto_stream_salsa20_keybytes(void); 26 | 27 | #define crypto_stream_salsa20_NONCEBYTES 8U 28 | SODIUM_EXPORT 29 | size_t crypto_stream_salsa20_noncebytes(void); 30 | 31 | SODIUM_EXPORT 32 | int crypto_stream_salsa20(unsigned char *c, unsigned long long clen, 33 | const unsigned char *n, const unsigned char *k); 34 | 35 | SODIUM_EXPORT 36 | int crypto_stream_salsa20_xor(unsigned char *c, const unsigned char *m, 37 | unsigned long long mlen, const unsigned char *n, 38 | const unsigned char *k); 39 | 40 | SODIUM_EXPORT 41 | int crypto_stream_salsa20_xor_ic(unsigned char *c, const unsigned char *m, 42 | unsigned long long mlen, 43 | const unsigned char *n, uint64_t ic, 44 | const unsigned char *k); 45 | 46 | SODIUM_EXPORT 47 | void crypto_stream_salsa20_keygen(unsigned char k[crypto_stream_salsa20_KEYBYTES]); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Core.Tests/Hypepool.Core.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | false 7 | Library 8 | Hypepool.Core.Tests 9 | Hypepool.Core.Tests 10 | 11 | 12 | x64;x86 13 | 14 | 15 | 16 | latest 17 | 18 | 19 | 20 | latest 21 | 22 | 23 | 24 | latest 25 | 26 | 27 | 28 | latest 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Common.Tests/Hypepool.Common.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | false 7 | Library 8 | Hypepool.Common.Tests 9 | Hypepool.Common.Tests 10 | 11 | 12 | x64;x86 13 | 14 | 15 | 16 | latest 17 | 18 | 19 | 20 | latest 21 | 22 | 23 | 24 | latest 25 | 26 | 27 | 28 | latest 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Stratum/Requests/MoneroLoginRequest.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | 29 | namespace Hypepool.Monero.Stratum.Requests 30 | { 31 | public class MoneroLoginRequest 32 | { 33 | [JsonProperty("login")] 34 | public string Login { get; set; } 35 | 36 | [JsonProperty("pass")] 37 | public string Password { get; set; } 38 | 39 | [JsonProperty("agent")] 40 | public string UserAgent { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/include_base_utils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | #pragma once 28 | 29 | #define BOOST_FILESYSTEM_VERSION 3 30 | #define ENABLE_RELEASE_LOGGING 31 | 32 | #include "misc_log_ex.h" 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream_xsalsa20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_xsalsa20_H 2 | #define crypto_stream_xsalsa20_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | #include 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # ifdef __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_stream_xsalsa20_KEYBYTES 32U 24 | SODIUM_EXPORT 25 | size_t crypto_stream_xsalsa20_keybytes(void); 26 | 27 | #define crypto_stream_xsalsa20_NONCEBYTES 24U 28 | SODIUM_EXPORT 29 | size_t crypto_stream_xsalsa20_noncebytes(void); 30 | 31 | SODIUM_EXPORT 32 | int crypto_stream_xsalsa20(unsigned char *c, unsigned long long clen, 33 | const unsigned char *n, const unsigned char *k); 34 | 35 | SODIUM_EXPORT 36 | int crypto_stream_xsalsa20_xor(unsigned char *c, const unsigned char *m, 37 | unsigned long long mlen, const unsigned char *n, 38 | const unsigned char *k); 39 | 40 | SODIUM_EXPORT 41 | int crypto_stream_xsalsa20_xor_ic(unsigned char *c, const unsigned char *m, 42 | unsigned long long mlen, 43 | const unsigned char *n, uint64_t ic, 44 | const unsigned char *k); 45 | 46 | SODIUM_EXPORT 47 | void crypto_stream_xsalsa20_keygen(unsigned char k[crypto_stream_xsalsa20_KEYBYTES]); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/net/rpc_method_name.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | 28 | #pragma once 29 | 30 | 31 | #define RPC_METHOD_NAME(name) static inline const char* methodname(){return name;} 32 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_stream_xchacha20.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_stream_xchacha20_H 2 | #define crypto_stream_xchacha20_H 3 | 4 | /* 5 | * WARNING: This is just a stream cipher. It is NOT authenticated encryption. 6 | * While it provides some protection against eavesdropping, it does NOT 7 | * provide any security against active attacks. 8 | * Unless you know what you're doing, what you are looking for is probably 9 | * the crypto_box functions. 10 | */ 11 | 12 | #include 13 | #include 14 | #include "export.h" 15 | 16 | #ifdef __cplusplus 17 | # ifdef __GNUC__ 18 | # pragma GCC diagnostic ignored "-Wlong-long" 19 | # endif 20 | extern "C" { 21 | #endif 22 | 23 | #define crypto_stream_xchacha20_KEYBYTES 32U 24 | SODIUM_EXPORT 25 | size_t crypto_stream_xchacha20_keybytes(void); 26 | 27 | #define crypto_stream_xchacha20_NONCEBYTES 24U 28 | SODIUM_EXPORT 29 | size_t crypto_stream_xchacha20_noncebytes(void); 30 | 31 | SODIUM_EXPORT 32 | int crypto_stream_xchacha20(unsigned char *c, unsigned long long clen, 33 | const unsigned char *n, const unsigned char *k); 34 | 35 | SODIUM_EXPORT 36 | int crypto_stream_xchacha20_xor(unsigned char *c, const unsigned char *m, 37 | unsigned long long mlen, const unsigned char *n, 38 | const unsigned char *k); 39 | 40 | SODIUM_EXPORT 41 | int crypto_stream_xchacha20_xor_ic(unsigned char *c, const unsigned char *m, 42 | unsigned long long mlen, 43 | const unsigned char *n, uint64_t ic, 44 | const unsigned char *k); 45 | 46 | SODIUM_EXPORT 47 | void crypto_stream_xchacha20_keygen(unsigned char k[crypto_stream_xchacha20_KEYBYTES]); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Hypepool.Core.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | x64;x86 7 | true 8 | 9 | 10 | 11 | true 12 | latest 13 | 14 | 15 | 16 | true 17 | latest 18 | 19 | 20 | 21 | true 22 | latest 23 | 24 | 25 | 26 | true 27 | latest 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Daemon/DaemonException.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using System; 27 | using System.Net; 28 | 29 | namespace Hypepool.Common.Daemon 30 | { 31 | public class DaemonException : Exception 32 | { 33 | public HttpStatusCode Code { get; set; } 34 | 35 | public DaemonException(string msg) 36 | : base(msg) 37 | { 38 | } 39 | 40 | public DaemonException(HttpStatusCode code, string msg) 41 | : base(msg) 42 | { 43 | Code = code; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/cryptonote_protocol/blobdatatype.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | namespace cryptonote 34 | { 35 | typedef std::string blobdata; 36 | } 37 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/global_stream_operators.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | 28 | #pragma once 29 | 30 | std::stringstream& operator<<(std::stringstream& out, const std::wstring& ws) 31 | { 32 | std::string as = string_encoding::convert_to_ansii(ws); 33 | out << as; 34 | return out; 35 | } 36 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/random.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include 34 | 35 | void generate_random_bytes_not_thread_safe(size_t n, void *result); 36 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Pools/IPool.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System.Reactive; 28 | using System.Threading.Tasks; 29 | using Hypepool.Common.JsonRpc; 30 | using Hypepool.Common.Stratum; 31 | 32 | namespace Hypepool.Common.Pools 33 | { 34 | public interface IPool 35 | { 36 | Task Initialize(); 37 | 38 | Task Start(); 39 | 40 | void OnConnect(IStratumClient client); 41 | 42 | void OnDisconnect(string subscriptionId); 43 | 44 | Task OnRequestAsync(IStratumClient client, Timestamped timeStampedRequest); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Daemon/Requests/GetBlockTemplateRequest.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | 29 | namespace Hypepool.Monero.Daemon.Requests 30 | { 31 | public class GetBlockTemplateRequest 32 | { 33 | /// 34 | /// Address of wallet to receive coinbase transactions if block is successfully mined. 35 | /// 36 | [JsonProperty("wallet_address")] 37 | public string WalletAddress { get; set; } 38 | 39 | [JsonProperty("reserve_size")] 40 | public uint ReserveSize { get; set; } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/randombytes.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef randombytes_H 3 | #define randombytes_H 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "export.h" 11 | 12 | #ifdef __cplusplus 13 | # ifdef __GNUC__ 14 | # pragma GCC diagnostic ignored "-Wlong-long" 15 | # endif 16 | extern "C" { 17 | #endif 18 | 19 | typedef struct randombytes_implementation { 20 | const char *(*implementation_name)(void); /* required */ 21 | uint32_t (*random)(void); /* required */ 22 | void (*stir)(void); /* optional */ 23 | uint32_t (*uniform)(const uint32_t upper_bound); /* optional, a default implementation will be used if NULL */ 24 | void (*buf)(void * const buf, const size_t size); /* required */ 25 | int (*close)(void); /* optional */ 26 | } randombytes_implementation; 27 | 28 | #define randombytes_SEEDBYTES 32U 29 | SODIUM_EXPORT 30 | size_t randombytes_seedbytes(void); 31 | 32 | SODIUM_EXPORT 33 | void randombytes_buf(void * const buf, const size_t size); 34 | 35 | SODIUM_EXPORT 36 | void randombytes_buf_deterministic(void * const buf, const size_t size, 37 | const unsigned char seed[randombytes_SEEDBYTES]); 38 | 39 | SODIUM_EXPORT 40 | uint32_t randombytes_random(void); 41 | 42 | SODIUM_EXPORT 43 | uint32_t randombytes_uniform(const uint32_t upper_bound); 44 | 45 | SODIUM_EXPORT 46 | void randombytes_stir(void); 47 | 48 | SODIUM_EXPORT 49 | int randombytes_close(void); 50 | 51 | SODIUM_EXPORT 52 | int randombytes_set_implementation(randombytes_implementation *impl); 53 | 54 | SODIUM_EXPORT 55 | const char *randombytes_implementation_name(void); 56 | 57 | /* -- NaCl compatibility interface -- */ 58 | 59 | SODIUM_EXPORT 60 | void randombytes(unsigned char * const buf, const unsigned long long buf_len); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Stratum/Responses/MoneroLoginResponse.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | 29 | namespace Hypepool.Monero.Stratum.Responses 30 | { 31 | public class MoneroJobParams 32 | { 33 | [JsonProperty("job_id")] 34 | public string JobId { get; set; } 35 | 36 | public string Blob { get; set; } 37 | 38 | public string Target { get; set; } 39 | } 40 | 41 | public class MoneroLoginResponse : MoneroResponseBase 42 | { 43 | public string Id { get; set; } 44 | 45 | public MoneroJobParams Job { get; set; } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/ringct/rctCryptoOps.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | extern "C" { 34 | #include "crypto/crypto-ops.h" 35 | } 36 | 37 | void sc_reduce32copy(unsigned char * scopy, const unsigned char *s); 38 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Stratum/StratumException.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System; 28 | using Hypepool.Common.Stratum; 29 | 30 | namespace Hypepool.Core.Stratum 31 | { 32 | /// 33 | /// Stratum exeption. 34 | /// 35 | public class StratumException : Exception 36 | { 37 | /// 38 | /// Error code. 39 | /// 40 | public StratumError Code { get; set; } 41 | 42 | public StratumException(StratumError code, string message) 43 | : base(message) 44 | { 45 | Code = code; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Benchmarks/Utils/Helpers/Time/FastClock.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System; 28 | using BenchmarkDotNet.Attributes; 29 | using BenchmarkDotNet.Attributes.Exporters; 30 | using BenchmarkDotNet.Attributes.Jobs; 31 | using Hypepool.Common.Utils.Helpers.Time; 32 | 33 | namespace Hypepool.Benchmarks.Utils.Helpers.Time 34 | { 35 | [ShortRunJob, CsvMeasurementsExporter, RPlotExporter] 36 | public class Fastclock 37 | { 38 | [Benchmark] 39 | public DateTime MasterClockNow() => MasterClock.Now; 40 | 41 | [Benchmark] 42 | public DateTime DateTimeNow() => DateTime.Now; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Tests/Hypepool.Monero.Tests/Hypepool.Monero.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 2.0.5 6 | false 7 | Library 8 | Hypepool.Monero.Tests 9 | Hypepool.Monero.Tests 10 | 11 | 12 | x64;x86 13 | 14 | 15 | 16 | latest 17 | 18 | 19 | 20 | latest 21 | 22 | 23 | 24 | latest 25 | 26 | 27 | 28 | latest 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Stratum/IStratumServer.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System; 28 | using System.Collections.Generic; 29 | using Hypepool.Common.Pools; 30 | using NetUV.Core.Handles; 31 | 32 | namespace Hypepool.Common.Stratum 33 | { 34 | public interface IStratumServer 35 | { 36 | IReadOnlyDictionary Ports { get; } 37 | 38 | IReadOnlyDictionary Clients { get; } 39 | 40 | void Start(IPool pool); 41 | 42 | void Stop(); 43 | 44 | void DisconnectClient(IStratumClient client); 45 | 46 | void ForEachClient(Action action); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Registries/ServerRegistry.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Common.Stratum; 28 | using Hypepool.Core.Stratum; 29 | using Stashbox; 30 | 31 | namespace Hypepool.Core.Internals.Registries 32 | { 33 | public class ServerRegistry : IRegistry 34 | { 35 | private readonly StashboxContainer _container; 36 | 37 | public ServerRegistry(StashboxContainer container) 38 | { 39 | _container = container; 40 | } 41 | 42 | public void Run() 43 | { 44 | _container.RegisterSingleton(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/sha3/sph_fugue.h: -------------------------------------------------------------------------------- 1 | #ifndef SPH_FUGUE_H__ 2 | #define SPH_FUGUE_H__ 3 | 4 | #include 5 | #include "sph_types.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C"{ 9 | #endif 10 | 11 | #define SPH_SIZE_fugue224 224 12 | 13 | #define SPH_SIZE_fugue256 256 14 | 15 | #define SPH_SIZE_fugue384 384 16 | 17 | #define SPH_SIZE_fugue512 512 18 | 19 | typedef struct { 20 | #ifndef DOXYGEN_IGNORE 21 | sph_u32 partial; 22 | unsigned partial_len; 23 | unsigned round_shift; 24 | sph_u32 S[36]; 25 | #if SPH_64 26 | sph_u64 bit_count; 27 | #else 28 | sph_u32 bit_count_high, bit_count_low; 29 | #endif 30 | #endif 31 | } sph_fugue_context; 32 | 33 | typedef sph_fugue_context sph_fugue224_context; 34 | 35 | typedef sph_fugue_context sph_fugue256_context; 36 | 37 | typedef sph_fugue_context sph_fugue384_context; 38 | 39 | typedef sph_fugue_context sph_fugue512_context; 40 | 41 | void sph_fugue224_init(void *cc); 42 | 43 | void sph_fugue224(void *cc, const void *data, size_t len); 44 | 45 | void sph_fugue224_close(void *cc, void *dst); 46 | 47 | void sph_fugue224_addbits_and_close( 48 | void *cc, unsigned ub, unsigned n, void *dst); 49 | 50 | void sph_fugue256_init(void *cc); 51 | 52 | void sph_fugue256(void *cc, const void *data, size_t len); 53 | 54 | void sph_fugue256_close(void *cc, void *dst); 55 | 56 | void sph_fugue256_addbits_and_close( 57 | void *cc, unsigned ub, unsigned n, void *dst); 58 | 59 | void sph_fugue384_init(void *cc); 60 | 61 | void sph_fugue384(void *cc, const void *data, size_t len); 62 | 63 | void sph_fugue384_close(void *cc, void *dst); 64 | 65 | void sph_fugue384_addbits_and_close( 66 | void *cc, unsigned ub, unsigned n, void *dst); 67 | 68 | void sph_fugue512_init(void *cc); 69 | 70 | void sph_fugue512(void *cc, const void *data, size_t len); 71 | 72 | void sph_fugue512_close(void *cc, void *dst); 73 | 74 | void sph_fugue512_addbits_and_close( 75 | void *cc, unsigned ub, unsigned n, void *dst); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Factories/Core/ICoreFactory.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using Hypepool.Core.Core; 27 | using Hypepool.Core.Utils.Logging; 28 | 29 | namespace Hypepool.Core.Internals.Factories.Core 30 | { 31 | public interface ICoreFactory 32 | { 33 | /// 34 | /// Returns engine instance. 35 | /// 36 | /// 37 | IEngine GetEngine(); 38 | 39 | /// 40 | /// Returns log manager. 41 | /// 42 | /// 43 | ILogManager GetLogManager(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Factories/Server/ServerFactory.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using Hypepool.Common.Factories.Server; 27 | using Hypepool.Common.Stratum; 28 | using Stashbox; 29 | 30 | namespace Hypepool.Core.Internals.Factories.Server 31 | { 32 | public class ServerFactory : IServerFactory 33 | { 34 | private readonly IDependencyResolver _container; 35 | 36 | public ServerFactory(IDependencyResolver container) 37 | { 38 | _container = container; 39 | } 40 | 41 | public IStratumServer GetStratumServer() 42 | { 43 | return _container.Resolve(); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_onetimeauth.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_onetimeauth_H 2 | #define crypto_onetimeauth_H 3 | 4 | #include 5 | 6 | #include "crypto_onetimeauth_poly1305.h" 7 | #include "export.h" 8 | 9 | #ifdef __cplusplus 10 | # ifdef __GNUC__ 11 | # pragma GCC diagnostic ignored "-Wlong-long" 12 | # endif 13 | extern "C" { 14 | #endif 15 | 16 | typedef crypto_onetimeauth_poly1305_state crypto_onetimeauth_state; 17 | 18 | SODIUM_EXPORT 19 | size_t crypto_onetimeauth_statebytes(void); 20 | 21 | #define crypto_onetimeauth_BYTES crypto_onetimeauth_poly1305_BYTES 22 | SODIUM_EXPORT 23 | size_t crypto_onetimeauth_bytes(void); 24 | 25 | #define crypto_onetimeauth_KEYBYTES crypto_onetimeauth_poly1305_KEYBYTES 26 | SODIUM_EXPORT 27 | size_t crypto_onetimeauth_keybytes(void); 28 | 29 | #define crypto_onetimeauth_PRIMITIVE "poly1305" 30 | SODIUM_EXPORT 31 | const char *crypto_onetimeauth_primitive(void); 32 | 33 | SODIUM_EXPORT 34 | int crypto_onetimeauth(unsigned char *out, const unsigned char *in, 35 | unsigned long long inlen, const unsigned char *k); 36 | 37 | SODIUM_EXPORT 38 | int crypto_onetimeauth_verify(const unsigned char *h, const unsigned char *in, 39 | unsigned long long inlen, const unsigned char *k) 40 | __attribute__ ((warn_unused_result)); 41 | 42 | SODIUM_EXPORT 43 | int crypto_onetimeauth_init(crypto_onetimeauth_state *state, 44 | const unsigned char *key); 45 | 46 | SODIUM_EXPORT 47 | int crypto_onetimeauth_update(crypto_onetimeauth_state *state, 48 | const unsigned char *in, 49 | unsigned long long inlen); 50 | 51 | SODIUM_EXPORT 52 | int crypto_onetimeauth_final(crypto_onetimeauth_state *state, 53 | unsigned char *out); 54 | 55 | SODIUM_EXPORT 56 | void crypto_onetimeauth_keygen(unsigned char k[crypto_onetimeauth_KEYBYTES]); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/hash-extra-blake.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "blake256.h" 35 | 36 | void hash_extra_blake(const void *data, size_t length, char *hash) { 37 | blake256_hash((uint8_t*)hash, data, length); 38 | } 39 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/hash-extra-groestl.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "groestl.h" 35 | 36 | void hash_extra_groestl(const void *data, size_t length, char *hash) { 37 | groestl(data, length * 8, (uint8_t*)hash); 38 | } 39 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Registries/CoreRegistry.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Core.Core; 28 | using Hypepool.Core.Utils.Logging; 29 | using Stashbox; 30 | 31 | namespace Hypepool.Core.Internals.Registries 32 | { 33 | public class CoreRegistery : IRegistry 34 | { 35 | private readonly StashboxContainer _container; 36 | 37 | public CoreRegistery(StashboxContainer container) 38 | { 39 | _container = container; 40 | } 41 | 42 | public void Run() 43 | { 44 | _container.RegisterSingleton(); 45 | _container.RegisterSingleton(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/Daemon/Responses/GetBlockTemplateResponse.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Newtonsoft.Json; 28 | 29 | namespace Hypepool.Monero.Daemon.Responses 30 | { 31 | public class GetBlockTemplateResponse 32 | { 33 | [JsonProperty("blocktemplate_blob")] 34 | public string Blob { get; set; } 35 | 36 | public long Difficulty { get; set; } 37 | 38 | public uint Height { get; set; } 39 | 40 | [JsonProperty("prev_hash")] 41 | public string PreviousBlockhash { get; set; } 42 | 43 | [JsonProperty("reserved_offset")] 44 | public uint ReservedOffset { get; set; } 45 | 46 | public string Status { get; set; } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/net/levin_server_cp.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | 28 | 29 | 30 | #ifndef _HTTP_SERVER_CP_H_ 31 | #define _HTTP_SERVER_CP_H_ 32 | 33 | #include "abstract_tcp_server_cp.h" 34 | #include "levin_protocol_handler.h" 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef cp_server_impl cp_levin_server; 40 | } 41 | } 42 | 43 | 44 | 45 | #endif 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/Blockchains/Monero/MoneroWorkerContext.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using Hypepool.Common.Mining.Context; 28 | 29 | namespace Hypepool.Monero 30 | { 31 | public class MoneroWorkerContext : WorkerContext 32 | { 33 | public string MinerName { get; set; } 34 | 35 | public string WorkerName { get; set; } 36 | 37 | /// 38 | /// Payment ID is an arbitrary and optional transaction attachment that consists of 32 bytes (64 hexadecimal characters) 39 | /// or 8 bytes (in the case of integrated addresses). 40 | /// https://getmonero.org/resources/moneropedia/paymentid.html 41 | /// 42 | public string PaymentId { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | // FIXME: Why is this ifdef needed? Hopefully making it struct won't break things. 34 | 35 | /* 36 | #if defined(_MSC_VER) 37 | #define POD_CLASS struct 38 | #else 39 | #define POD_CLASS class 40 | #endif 41 | */ 42 | 43 | #define POD_CLASS struct 44 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/skein.h: -------------------------------------------------------------------------------- 1 | #ifndef _SKEIN_H_ 2 | #define _SKEIN_H_ 1 3 | /************************************************************************** 4 | ** 5 | ** Interface declarations and internal definitions for Skein hashing. 6 | ** 7 | ** Source code author: Doug Whiting, 2008. 8 | ** 9 | ** This algorithm and source code is released to the public domain. 10 | ** 11 | *************************************************************************** 12 | ** 13 | ** The following compile-time switches may be defined to control some 14 | ** tradeoffs between speed, code size, error checking, and security. 15 | ** 16 | ** The "default" note explains what happens when the switch is not defined. 17 | ** 18 | ** SKEIN_DEBUG -- make callouts from inside Skein code 19 | ** to examine/display intermediate values. 20 | ** [default: no callouts (no overhead)] 21 | ** 22 | ** SKEIN_ERR_CHECK -- how error checking is handled inside Skein 23 | ** code. If not defined, most error checking 24 | ** is disabled (for performance). Otherwise, 25 | ** the switch value is interpreted as: 26 | ** 0: use assert() to flag errors 27 | ** 1: return SKEIN_FAIL to flag errors 28 | ** 29 | ***************************************************************************/ 30 | #include "skein_port.h" /* get platform-specific definitions */ 31 | 32 | typedef enum 33 | { 34 | SKEIN_SUCCESS = 0, /* return codes from Skein calls */ 35 | SKEIN_FAIL = 1, 36 | SKEIN_BAD_HASHLEN = 2 37 | } 38 | HashReturn; 39 | 40 | typedef size_t DataLength; /* bit count type */ 41 | typedef u08b_t BitSequence; /* bit stream type */ 42 | 43 | /* "all-in-one" call */ 44 | HashReturn skein_hash(int hashbitlen, const BitSequence *data, 45 | DataLength databitlen, BitSequence *hashval); 46 | 47 | #endif /* ifndef _SKEIN_H_ */ 48 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/hash-extra-skein.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | 34 | #include "hash-ops.h" 35 | #include "skein.h" 36 | 37 | void hash_extra_skein(const void *data, size_t length, char *hash) { 38 | int r = skein_hash(8 * HASH_SIZE, data, 8 * length, (uint8_t*)hash); 39 | assert(SKEIN_SUCCESS == r); 40 | } 41 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_sign_edwards25519sha512batch.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_sign_edwards25519sha512batch_H 2 | #define crypto_sign_edwards25519sha512batch_H 3 | 4 | /* 5 | * WARNING: This construction was a prototype, which should not be used 6 | * any more in new projects. 7 | * 8 | * crypto_sign_edwards25519sha512batch is provided for applications 9 | * initially built with NaCl, but as recommended by the author of this 10 | * construction, new applications should use ed25519 instead. 11 | * 12 | * In Sodium, you should use the high-level crypto_sign_*() functions instead. 13 | */ 14 | 15 | #include 16 | #include "export.h" 17 | 18 | #ifdef __cplusplus 19 | # ifdef __GNUC__ 20 | # pragma GCC diagnostic ignored "-Wlong-long" 21 | # endif 22 | extern "C" { 23 | #endif 24 | 25 | #define crypto_sign_edwards25519sha512batch_BYTES 64U 26 | #define crypto_sign_edwards25519sha512batch_PUBLICKEYBYTES 32U 27 | #define crypto_sign_edwards25519sha512batch_SECRETKEYBYTES (32U + 32U) 28 | 29 | SODIUM_EXPORT 30 | int crypto_sign_edwards25519sha512batch(unsigned char *sm, 31 | unsigned long long *smlen_p, 32 | const unsigned char *m, 33 | unsigned long long mlen, 34 | const unsigned char *sk) 35 | __attribute__ ((deprecated)); 36 | 37 | SODIUM_EXPORT 38 | int crypto_sign_edwards25519sha512batch_open(unsigned char *m, 39 | unsigned long long *mlen_p, 40 | const unsigned char *sm, 41 | unsigned long long smlen, 42 | const unsigned char *pk) 43 | __attribute__ ((deprecated)); 44 | 45 | SODIUM_EXPORT 46 | int crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk, 47 | unsigned char *sk) 48 | __attribute__ ((deprecated)); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Core/Internals/Factories/Core/CoreFactory.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | using Hypepool.Core.Core; 27 | using Hypepool.Core.Utils.Logging; 28 | using Stashbox; 29 | 30 | namespace Hypepool.Core.Internals.Factories.Core 31 | { 32 | public class CoreFactory: ICoreFactory 33 | { 34 | private readonly IDependencyResolver _container; 35 | 36 | public CoreFactory(IDependencyResolver container) 37 | { 38 | _container = container; 39 | } 40 | 41 | public IEngine GetEngine() 42 | { 43 | return _container.Resolve(); 44 | } 45 | 46 | public ILogManager GetLogManager() 47 | { 48 | return _container.Resolve(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/hash-extra-jh.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2017, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "jh.h" 37 | #include "hash-ops.h" 38 | 39 | void hash_extra_jh(const void *data, size_t length, char *hash) { 40 | int r = jh_hash(HASH_SIZE * 8, data, 8 * length, (uint8_t*)hash); 41 | assert(SUCCESS == r); 42 | } 43 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/contrib/epee/include/net/http_server_thread_per_connect.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are met: 6 | // * Redistributions of source code must retain the above copyright 7 | // notice, this list of conditions and the following disclaimer. 8 | // * Redistributions in binary form must reproduce the above copyright 9 | // notice, this list of conditions and the following disclaimer in the 10 | // documentation and/or other materials provided with the distribution. 11 | // * Neither the name of the Andrey N. Sabelnikov nor the 12 | // names of its contributors may be used to endorse or promote products 13 | // derived from this software without specific prior written permission. 14 | // 15 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY 19 | // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | // 26 | 27 | 28 | 29 | #ifndef _HTTP_SERVER_CP_H_ 30 | #define _HTTP_SERVER_CP_H_ 31 | 32 | #include "abstract_tcp_server.h" 33 | #include "http_server.h" 34 | 35 | namespace epee 36 | { 37 | namespace net_utils 38 | { 39 | typedef abstract_tcp_server mt_http_server_file_system; 40 | typedef abstract_tcp_server mt_http_server_custum_handling; 41 | 42 | } 43 | } 44 | 45 | 46 | #endif 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/Hashing/libcryptonote/crypto/oaes_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * OpenAES License 4 | * --------------------------------------------------------------------------- 5 | * Copyright (c) 2012, Nabil S. Al Ramli, www.nalramli.com 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions are met: 10 | * 11 | * - Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * - Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | * --------------------------------------------------------------------------- 29 | */ 30 | 31 | #ifndef _OAES_CONFIG_H 32 | #define _OAES_CONFIG_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | //#ifndef OAES_HAVE_ISAAC 39 | //#define OAES_HAVE_ISAAC 1 40 | //#endif // OAES_HAVE_ISAAC 41 | 42 | //#ifndef OAES_DEBUG 43 | //#define OAES_DEBUG 0 44 | //#endif // OAES_DEBUG 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif // _OAES_CONFIG_H 51 | -------------------------------------------------------------------------------- /src/Hashing/libmultihash/windows/include/libsodium/sodium/crypto_secretbox_xsalsa20poly1305.h: -------------------------------------------------------------------------------- 1 | #ifndef crypto_secretbox_xsalsa20poly1305_H 2 | #define crypto_secretbox_xsalsa20poly1305_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #ifdef __cplusplus 8 | # ifdef __GNUC__ 9 | # pragma GCC diagnostic ignored "-Wlong-long" 10 | # endif 11 | extern "C" { 12 | #endif 13 | 14 | #define crypto_secretbox_xsalsa20poly1305_KEYBYTES 32U 15 | SODIUM_EXPORT 16 | size_t crypto_secretbox_xsalsa20poly1305_keybytes(void); 17 | 18 | #define crypto_secretbox_xsalsa20poly1305_NONCEBYTES 24U 19 | SODIUM_EXPORT 20 | size_t crypto_secretbox_xsalsa20poly1305_noncebytes(void); 21 | 22 | #define crypto_secretbox_xsalsa20poly1305_MACBYTES 16U 23 | SODIUM_EXPORT 24 | size_t crypto_secretbox_xsalsa20poly1305_macbytes(void); 25 | 26 | #define crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES 16U 27 | SODIUM_EXPORT 28 | size_t crypto_secretbox_xsalsa20poly1305_boxzerobytes(void); 29 | 30 | #define crypto_secretbox_xsalsa20poly1305_ZEROBYTES \ 31 | (crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES + \ 32 | crypto_secretbox_xsalsa20poly1305_MACBYTES) 33 | SODIUM_EXPORT 34 | size_t crypto_secretbox_xsalsa20poly1305_zerobytes(void); 35 | 36 | SODIUM_EXPORT 37 | int crypto_secretbox_xsalsa20poly1305(unsigned char *c, 38 | const unsigned char *m, 39 | unsigned long long mlen, 40 | const unsigned char *n, 41 | const unsigned char *k); 42 | 43 | SODIUM_EXPORT 44 | int crypto_secretbox_xsalsa20poly1305_open(unsigned char *m, 45 | const unsigned char *c, 46 | unsigned long long clen, 47 | const unsigned char *n, 48 | const unsigned char *k) 49 | __attribute__ ((warn_unused_result)); 50 | 51 | SODIUM_EXPORT 52 | void crypto_secretbox_xsalsa20poly1305_keygen(unsigned char k[crypto_secretbox_xsalsa20poly1305_KEYBYTES]); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/Core/Hypepool.Common/Mining/Jobs/JobCounter.cs: -------------------------------------------------------------------------------- 1 | #region license 2 | // 3 | // hypepool 4 | // https://github.com/bonesoul/hypepool 5 | // 6 | // Copyright (c) 2013 - 2018 Hüseyin Uslu 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in all 16 | // copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | // SOFTWARE. 25 | #endregion 26 | 27 | using System.Threading; 28 | 29 | namespace Hypepool.Common.Mining.Jobs 30 | { 31 | /// 32 | /// Job id counter. 33 | /// 34 | public class JobCounter 35 | { 36 | private int _last; 37 | 38 | public JobCounter() 39 | { 40 | _last = 0; 41 | } 42 | 43 | /// 44 | /// Returns a new job id. 45 | /// 46 | /// 47 | public int GetNext() 48 | { 49 | Interlocked.CompareExchange(ref _last, 0, int.MaxValue); // if we reached maxed value, reset to 1. 50 | Interlocked.Increment(ref _last); // atomic increase _last. 51 | 52 | return _last; 53 | } 54 | } 55 | } 56 | --------------------------------------------------------------------------------