Comments (23)
I seriously doubt that would make hashing any faster on the architectures for which we already have assembly code (ARM, x86, x86-64).
When mining, you don't need to compute a full hash, but only part of it, and that allows for significant optimizations. Another important problem with relying on an external API is that it may make it impossible to take full advantage of SIMD processing.
That said, I admittedly have no direct experience with the Linux Crypto API, so feel free to prove me wrong. :-)
from cpuminer.
For my bench (openssl and dm-crypt), I have 4x more performance (and openssl/dm-crypt have too already asl in user space), because in kernel space you don't check the memory acces (trusted zone vs not trused zone).
Test that's can be very interesting...
from cpuminer.
For my bench (openssl and dm-crypt), I have 4x more performance
For what algorithm and data size, and on what kind of hardware?
I have just run some quick and dirty benchmarks (based on this example), and the performance of SHA-256 on small data (80 bytes) was far from satisfactory on my system. But then again, this is the first time I've used this API, so I may well be missing something.
from cpuminer.
aes256 and aes512, on volume of GB, on intel atom z530 and core i5 750.
I think you need send multiple syscall to send multiple work to do and turn the work to do.
from cpuminer.
Such a performance increase makes sense if you are processing large streams of data, but for mining we are only interested in hashing very small quantities of data at a time.
from cpuminer.
I think if it's have implemented that's for simple sha256, it's useful, because it's some work, more syscall, ...
from cpuminer.
I'm sorry but I am missing something in translation here... Could you please clarify?
from cpuminer.
I don't think the kernel do useless code. Maybe a queue of work can be transmited?
from cpuminer.
I never meant to insinuate that the kernel code or the API are useless. I can see plenty of use cases for the Crypto API, but that doesn't mean mining has to be one of them.
I don't know if there's a way to pass our data to the API in a way that would result in much faster hashing than what I tried above, as unfortunately I could find no real documentation.
from cpuminer.
For scrypt algo, the memory latency is very important no? gdb vs valgrind, kvm user space vs kernel space (without hardware virtualisation), ... all for that's have greate memory improvement into the kernel.
scrypt is mentionned here:
https://wiki.archlinux.org/index.php/Disk_Encryption
cryptsetup benchmark show greate improvement on usage of kernel space for sha512 and sha256;
5x on PBKDF2-sha512 on my core i5 750, 7x on my Intel Atom z530
from cpuminer.
This is all very interesting, but I won't be convinced until someone shows me an actual preliminary benchmark comparison for an algorithm and data size that are pertinent to this project.
from cpuminer.
On an AMD with kernel crypto API:
cryptsetup benchmark
PBKDF2-sha1 493679 iterations per second
PBKDF2-sha256 431868 iterations per second
PBKDF2-sha512 368697 iterations per second
PBKDF2-ripemd160 457493 iterations per second
PBKDF2-whirlpool 185654 iterations per second
With user space asm (gcrypt):
PBKDF2-sha1 344473 iterations per second
PBKDF2-sha256 189959 iterations per second
PBKDF2-sha512 127254 iterations per second
PBKDF2-ripemd160 276523 iterations per second
PBKDF2-whirlpool 134295 iterations per second
from cpuminer.
A cryptsetup benchmark is not relevant in our case. You need to provide a benchmark against the code that is currently in cpuminer.
from cpuminer.
I'm not sure understand the query. I'm not able to change cpuminer to use correctly this API.
While(1000){syscall with crypto API} -> product bad latency, you need do this loop into the kernel.
from cpuminer.
crypto API was used by bfgminer, then you have the code of usage into it.
from cpuminer.
Could you please point out where exactly in the source code of bfgminer you think the Crypto API is called?
from cpuminer.
https://github.com/luke-jr/bfgminer/blob/bfgminer/driver-cpu.c scanhash_c() have scanhash_cryptopp() is usefull too
from cpuminer.
That's not using the Crypto API at all. scanhash_c()
is defined in sha256_generic.c, and scanhash_cryptopp()
is defined in sha256_cryptopp.c.
from cpuminer.
then the --help is wrong, or I don't know read it, sorry.
from cpuminer.
The --help text is correct: scanhash_c()
corresponds to "Linux kernel sha256, implemented in C". That means that the C code was copied from the Linux kernel, not that the miner offloads hashing to the kernel.
from cpuminer.
:( I case of my cubox-i, I can enable CAAN (no graphic, ... but not important on server), only enable with the crypto API... then bad luck...
from cpuminer.
This doesn't seem to be going anywhere, so I'm closing this ticket for now.
I appreciate your good intentions, but I still stand by what I wrote in my first reply.
from cpuminer.
name : sha256
driver : sha256-caam
type : ahash
Then like amd crypto graphic co processor an hardware acelerator, very more fast than the cpu.
from cpuminer.
Related Issues (20)
- gm
- How to print out the blockheader, prior to hashing with sha256? HOT 1
- getting debug false positive flag HOT 8
- mweb support HOT 3
- Pl
- not accepting khash/s HOT 1
- virus HOT 1
- accepted: 0/1 (diff 0.000), 8.91 H/s booooo HOT 1
- program opens and closes automatically HOT 1
- Syntax error on line 4024 of the configure file. HOT 2
- Does cpuminer work for BTC? HOT 2
- API
- clang: error: no such file or directory: '@LIBCURL_CPPFLAGS@' HOT 6
- clang: error: no such file or directory: '@LIBCURL_CPPFLAGS@' HOT 1
- Add silent mode
- About Artificial Intelligence and Cryptocurrencies
- CPU Affinity/NO of Threads HOT 1
- macOS hints
- Custom signet hint HOT 1
- Can someone port this into a single Python Script?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpuminer.