Files
thehub/libs/crypto/sha1.h
T

43 lines
1.1 KiB
C++
Raw Permalink Normal View History

2017-11-09 19:34:51 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2014 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2014-04-28 03:09:13 +02:00
2018-01-16 10:47:52 +00:00
#ifndef FLOWEE_CRYPTO_SHA1_H
#define FLOWEE_CRYPTO_SHA1_H
2014-04-28 03:09:13 +02:00
#include <cstdint>
#include <cstdlib>
2014-04-28 03:09:13 +02:00
/** A hasher class for SHA1. */
2014-09-25 08:23:32 +02:00
class CSHA1
{
2014-04-28 03:09:13 +02:00
private:
uint32_t s[5];
unsigned char buf[64];
size_t bytes;
public:
2014-06-12 13:34:29 +02:00
static const size_t OUTPUT_SIZE = 20;
2014-04-28 03:09:13 +02:00
CSHA1();
CSHA1& write(const unsigned char* data, size_t len);
void finalize(unsigned char hash[OUTPUT_SIZE]);
CSHA1& reset();
2014-04-28 03:09:13 +02:00
};
2018-01-16 10:47:52 +00:00
#endif