mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Move source files to /src
This commit is contained in:
parent
4daff1ba79
commit
033ff07abf
2685 changed files with 9 additions and 7 deletions
35
src/acceleratedcryptographichash.h
Normal file
35
src/acceleratedcryptographichash.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#ifndef ACCELERATEDCRYPTOGRAPHICHASH_H
|
||||
#define ACCELERATEDCRYPTOGRAPHICHASH_H
|
||||
|
||||
/*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Copyright (C) 2020 Raspberry Pi Ltd
|
||||
*/
|
||||
|
||||
#include <QCryptographicHash>
|
||||
|
||||
#ifdef Q_OS_DARWIN
|
||||
#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
|
||||
{
|
||||
public:
|
||||
explicit AcceleratedCryptographicHash(QCryptographicHash::Algorithm method);
|
||||
virtual ~AcceleratedCryptographicHash();
|
||||
void addData(const char *data, int length);
|
||||
void addData(const QByteArray &data);
|
||||
QByteArray result();
|
||||
|
||||
protected:
|
||||
SHA256_CTX _sha256;
|
||||
};
|
||||
|
||||
#endif // ACCELERATEDCRYPTOGRAPHICHASH_H
|
Loading…
Add table
Add a link
Reference in a new issue