forked from goldendict/goldendict
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathripemd.hh
50 lines (41 loc) · 1.48 KB
/
ripemd.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2007 Michael Niedermayer <[email protected]>
// Copyright (C) 2013 James Almer <[email protected]>
// Copyright (C) 2015 Zhe Wang <[email protected]>
//
// Based on the RIPEMD-128 implementation from libavutil
//
// This program is a 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, version 3 of the License.
//
// You can get a copy of GNU General Public License along this program
// But you can always get it from http://www.gnu.org/licenses/gpl.txt
//
// 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.
#ifndef __RIPEMD_HH_INCLUDED__
#define __RIPEMD_HH_INCLUDED__
#include <stddef.h>
#include <QtGlobal>
#if defined( _MSC_VER ) && _MSC_VER < 1800 // VS2012 and older
#include <stdint_msvc.h>
#else
#include <stdint.h>
#endif
class RIPEMD128
{
public:
RIPEMD128();
// Update hash value
void update( const uchar * data, size_t len );
// Finish hashing and output digest value.
void digest( uchar * digest );
private:
quint64 count; // number of bytes in buffer
uchar buffer[64]; // 512-bit buffer of input values used in hash updating
quint32 state[10]; // current hash value
void transform( const uchar buffer[64] );
};
#endif // __RIPEMD_HH_INCLUDED__