mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Mac: use system hash functions
May perform better under emulation
This commit is contained in:
parent
65f9b9c1fd
commit
a6a4f0fc5b
2 changed files with 8 additions and 4 deletions
|
@ -25,7 +25,7 @@ set(HEADERS config.h imagewriter.h networkaccessmanagerfactory.h nan.h drivelist
|
|||
# Add dependencies
|
||||
if (APPLE)
|
||||
set_source_files_properties("icons/rpi-imager.icns" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||
set(DEPENDENCIES mac/macfile.cpp mac/macfile.h dependencies/mountutils/src/darwin/functions.cpp
|
||||
set(DEPENDENCIES acceleratedcryptographichash.cpp mac/macfile.cpp mac/macfile.h dependencies/mountutils/src/darwin/functions.cpp
|
||||
dependencies/drivelist/src/darwin/list.mm dependencies/drivelist/src/darwin/REDiskList.m icons/rpi-imager.icns)
|
||||
enable_language(OBJC C)
|
||||
elseif (UNIX)
|
||||
|
|
|
@ -9,10 +9,15 @@
|
|||
#include <QCryptographicHash>
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
typedef QCryptographicHash AcceleratedCryptographicHash;
|
||||
#include <CommonCrypto/CommonDigest.h>
|
||||
#define SHA256_CTX CC_SHA256_CTX
|
||||
#define SHA256_DIGEST_LENGTH CC_SHA256_DIGEST_LENGTH
|
||||
#define SHA256_Init CC_SHA256_Init
|
||||
#define SHA256_Update CC_SHA256_Update
|
||||
#define SHA256_Final CC_SHA256_Final
|
||||
#else
|
||||
|
||||
#include "openssl/sha.h"
|
||||
#endif
|
||||
|
||||
class AcceleratedCryptographicHash
|
||||
{
|
||||
|
@ -27,5 +32,4 @@ protected:
|
|||
SHA256_CTX _sha256;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // ACCELERATEDCRYPTOGRAPHICHASH_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue