mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-19 00:15:21 +01:00
Use accelerated hashing for verification
Modern CPUs have special instructions to accelerate computing SHA hashes. The Qt QCryptographicHash code is standard C, so not taking advantage of those though. Outsource the hashing to OpenSSL that does. Shaves off some seconds during verification stage.
This commit is contained in:
parent
2c5432fe7f
commit
8048b5e47c
6 changed files with 73 additions and 7 deletions
|
@ -9,12 +9,12 @@
|
|||
#include <QString>
|
||||
#include <QThread>
|
||||
#include <QFile>
|
||||
#include <QCryptographicHash>
|
||||
#include <QElapsedTimer>
|
||||
#include <fstream>
|
||||
#include <atomic>
|
||||
#include <time.h>
|
||||
#include <curl/curl.h>
|
||||
#include "acceleratedcryptographichash.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "windows/winfile.h"
|
||||
|
@ -172,7 +172,7 @@ protected:
|
|||
#endif
|
||||
QFile _cachefile;
|
||||
|
||||
QCryptographicHash _writehash, _verifyhash;
|
||||
AcceleratedCryptographicHash _writehash, _verifyhash;
|
||||
};
|
||||
|
||||
#endif // DOWNLOADTHREAD_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue