All Projects → Equim-chan → Cryptonight

Equim-chan / Cryptonight

Licence: mit
➿ Pure Go/ASM implementation of CryptoNight hash function with its variants, without any CGO binding.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Cryptonight

py-cryptonight
Python Cryptonight binding / extension. Monero hash function, proof-of-work, cn_slow_hash()
Stars: ✭ 20 (-65.52%)
Mutual labels:  hash, mining, monero
node-cryptonight
node bindings for cryptonight hashing
Stars: ✭ 15 (-74.14%)
Mutual labels:  hash, monero
monero-stratum-docker
No description or website provided.
Stars: ✭ 42 (-27.59%)
Mutual labels:  mining, monero
Nanominer
Nanominer is a versatile tool for mining cryptocurrencies on GPUs and CPUs.
Stars: ✭ 263 (+353.45%)
Mutual labels:  mining, monero
SilentCryptoMiner
A Silent (Hidden) Free Crypto Miner Builder - Supports ETH, ETC, XMR and many more.
Stars: ✭ 547 (+843.1%)
Mutual labels:  mining, monero
cryptoloot
Self Hosted Library for CryptoLoot
Stars: ✭ 46 (-20.69%)
Mutual labels:  mining, monero
SilentXMRMiner
A Silent (Hidden) Monero (XMR) Miner Builder
Stars: ✭ 417 (+618.97%)
Mutual labels:  mining, monero
Crypto-Webminer
Use Crypto Webminer JavaScript miner on various Cryptonight | CN-Lite | CN-Fast | CN-Fast2 | CN-Pico | CN-RWZ | CN-UPX2 | CN-Half | CN-Heavy | CN-Saber (BitTube) | Argon2id - Chukwa Stratum Pools
Stars: ✭ 166 (+186.21%)
Mutual labels:  mining, monero
Monero Stratum
Solo mining stratum for Monero & AEON with built-in Web-UI
Stars: ✭ 438 (+655.17%)
Mutual labels:  mining, monero
Xmr Miner
Web-based Cryptocurrency miner, built with Vue.js
Stars: ✭ 444 (+665.52%)
Mutual labels:  mining, monero
Deepminer
deepMiner webminer proxy (update for cryptoNight R)
Stars: ✭ 497 (+756.9%)
Mutual labels:  mining, monero
gpu-mining-on-ubuntu16
Simplified installation of cryptominers & dependencies on Ubuntu 16.04
Stars: ✭ 19 (-67.24%)
Mutual labels:  mining, monero
MM.Hash
Profit Switching Miner For HiveOS/Linux- OLD VERSION: Project Moved To SWARM! https://github.com/MaynardMiner/SWARM
Stars: ✭ 17 (-70.69%)
Mutual labels:  hash, mining
xrig
High performance cryptonight miner for AMD cards. Designed for large-scale use of RX Vega.
Stars: ✭ 23 (-60.34%)
Mutual labels:  mining, monero
Ethereum nvidia miner
💰 USB flash drive ISO image for Ethereum, Zcash and Monero mining with NVIDIA graphics cards and Ubuntu GNU/Linux (headless)
Stars: ✭ 772 (+1231.03%)
Mutual labels:  mining, monero
miningcore
Miningcore is a high-performance Mining Pool Software for Linux and Windows.
Stars: ✭ 554 (+855.17%)
Mutual labels:  mining, monero
CryptoProfitSwitcher
Extensible profit switcher for crypto coins and algorithms
Stars: ✭ 49 (-15.52%)
Mutual labels:  mining, monero
p2pool
Decentralized pool for Monero mining
Stars: ✭ 635 (+994.83%)
Mutual labels:  mining, monero
Coin Hive Stratum
use CoinHive's JavaScript miner on any stratum pool
Stars: ✭ 380 (+555.17%)
Mutual labels:  mining, monero
Multipoolminer
Monitors crypto mining pools in real-time in order to find the most profitable for your machine. Controls any miner that is available via command line.
Stars: ✭ 750 (+1193.1%)
Mutual labels:  mining, monero

= cryptonight Equim https://github.com/Equim-chan[@Equim-chan]

image:http://img.shields.io/badge/godoc-reference-5272B4.svg[GoDoc, link=https://godoc.org/ekyu.moe/cryptonight] image:https://img.shields.io/github/tag/Equim-chan/cryptonight.svg[tag, link=https://github.com/Equim-chan/cryptonight/tags] image:https://img.shields.io/circleci/project/github/Equim-chan/cryptonight.svg[CircleCI, link=https://circleci.com/gh/Equim-chan/cryptonight] image:https://img.shields.io/codecov/c/github/Equim-chan/cryptonight.svg[Codecov, link=https://codecov.io/github/Equim-chan/cryptonight] image:https://goreportcard.com/badge/github.com/Equim-chan/cryptonight[Go Report Card, link=https://goreportcard.com/report/github.com/Equim-chan/cryptonight] image:https://img.shields.io/github/license/Equim-chan/cryptonight.svg[License, link=https://github.com/Equim-chan/cryptonight/blob/master/LICENSE]

Pure Go/ASM implementation of CryptoNight hash function and some of its variant, without any CGO binding.

== Features

  • Support v0, v1, v2 variants.
  • No CGO hell, making builds easier and faster.
  • Hardware acceleration available for amd64 architecture.
  • Use of an internal sync.Pool to manage caches, since it is memory hard.

== Install [source,shell]

$ go get -u ekyu.moe/cryptonight

A simple CLI utility is also available with go get -u ekyu.moe/cryptonight/cmd/cnhash.

[source,plain]

Usage of cnhash: -bench Benchmark mode, don't do anything else. -in-file string Read input from file instead of stdin. -in-hex Read input in hex instead of binary. -include-diff Append the difficulty of the result hash to the output. If -out-binary is not given, the difficulty will be appeneded to the output in decimal with comma separated (CSV friendly) , otherwise it will be appeneded to the hash binary (which is 32 bytes long) directly, in 8 bytes little endian. -out-binary Produce output in binary (little endian) instead of hex. -out-file string Produce output to file instead of stdout. -variant int Set CryptoNight variant, default 0. This applies to benchmark mode as well.

== Example [source,go]

package main

import ( "fmt"

"ekyu.moe/cryptonight"

)

func main() { blob := []byte("Hello, 世界") fmt.Printf("%x\n", cryptonight.Sum(blob, 0)) // original // Output: 0999794e4e20d86e6a81b54495aeb370b6a9ae795fb5af4f778afaf07c0b2e0e

blob = []byte("variant 1 requires at least 43 bytes of input.")
fmt.Printf("%x\n", cryptonight.Sum(blob, 1)) // variant 1
// Output: 261124c5a6dca5d4aa3667d328a94ead9a819ae714e1f1dc113ceeb14f1ecf99

blob = []byte("Monero is cash for a connected world. It’s fast, private, and secure.")
fmt.Printf("%x\n", cryptonight.Sum(blob, 2)) // variant 2
// Output: abb61f40468c70234051e4bb5e8b670812473b2a71e02c9633ef94996a621b96

}

== Tested architectures

  • amd64 (w/ AVX, SSE, AES)
  • amd64 (w/o AVX, SSE, AES)
  • 386
  • arm64

== Benchmarks CPU: 4 x Intel(R) Xeon(R) CPU E3-1270 v3 @ 3.50GHz

[source,plain]

goos: linux goarch: amd64 pkg: ekyu.moe/cryptonight BenchmarkSum/v0-4 100 20208070 ns/op 21584 B/op 2 allocs/op BenchmarkSum/v1-4 100 20535318 ns/op 21584 B/op 2 allocs/op BenchmarkSum/v2-4 100 22328893 ns/op 21584 B/op 2 allocs/op BenchmarkSum/v0-parallel-4 100 10798945 ns/op 42664 B/op 2 allocs/op BenchmarkSum/v1-parallel-4 100 10316040 ns/op 42655 B/op 2 allocs/op BenchmarkSum/v2-parallel-4 100 11740615 ns/op 42661 B/op 2 allocs/op PASS

== Development While this repository is already out-of-box, which means what you need to do to use it in your code is just a go get (or dep ensure -add whatsoever), in case you want to hack on this library, some additional steps are required since it uses code generation.

=== Preprocess If you modified a source file in this library that uses C-kind macros (the comments tells), in order to expand them and generate the final code, https://linux.die.net/man/1/cpp[cpp(1)] is needed, which a part of GCC toolchain and should be already available if you have installed gcc (or MinGW for Windows) in your machine.

Once some modification is made in a file that used macro, simply use go generate ekyu.moe/cryptonight/\... to run the gcc preprocessor on them.

=== Packages information ekyu.moe/cryptonight/internal/aes:: From Go's crypto/aes. Since CryptoNight's use of AES is quite non-standard and not intended for encryption, you must use this package this package with care for project that's not CryptoNight associated.

ekyu.moe/cryptonight/internal/sha3:: From Go's golang.org/x/crypto/sha3. All CryptoNight specific additional works are made in cn.go only; other files are untouched at all.

ekyu.moe/cryptonight/groestl:: Grøstl-256 implementation. It is directly ported from C and not quite optimized.

ekyu.moe/cryptonight/jh:: JH-256 implementation. It is directly ported from C and not quite optimized.

=== Tests, coverage and benchmarks [source,shell]

$ go test -v -race -coverprofile=coverage.txt -covermode=atomic $ go tool cover -html=coverage.txt $ go test -v -run=^$ -bench=. -benchmem

=== TODO

  • [ ] ARM64-specific optimization
  • [x] Tests on other architectures
  • [x] Improve performance for variant 2
  • [ ] Improve performance for groestl and jh
  • [x] Try a nearly full assembly implementation (except for the final hash) for amd64

== References

== Donation If you find this lib helpful, maybe consider buying me a cup of coffee at

XMR:: 4777777jHFbZB4gyqrB1JHDtrGFusyj4b3M2nScYDPKEM133ng2QDrK9ycqizXS2XofADw5do5rU19LQmpTGCfeQTerm1Ti BTC:: 1Eqqqq9xR78wJyRXXgvR73HEfKdEwq68BT

Much thanks.

== License https://github.com/Equim-chan/cryptonight/blob/master/LICENSE[MIT]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].