KWallet

sha1.h
1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2001 George Staikos <staikos@kde.org>
4
5 Based heavily on SHA1 code from GPG 1.0.3:
6 SPDX-FileCopyrightText: 1998 FSF
7
8 SPDX-License-Identifier: LGPL-2.0-or-later
9*/
10
11#ifndef __sha1__ko__h
12#define __sha1__ko__h
13
14#include "kwalletbackend_export.h"
15
16/* @internal
17 */
18class KWALLETBACKEND_EXPORT SHA1
19{
20public:
21 SHA1();
22 ~SHA1();
23
24 /*
25 * The number of bits in the hash generated.
26 */
27 int size() const;
28
29 /*
30 * True if all settings are good and we are ready to hash.
31 */
32 bool readyToGo() const;
33
34 /*
35 * Process a block of data for the hash function.
36 */
37 int process(const void *block, int len);
38
39 /*
40 * Return the digest as a 20 byte array reference.
41 * Calling this makes readyToGo() == false.
42 */
43 const unsigned char *hash();
44
45 /*
46 * Reset the digest so a new one can be calculated.
47 */
48 int reset();
49
50protected:
51 int _hashlen;
52 bool _init;
53
54 long _h0, _h1, _h2, _h3, _h4;
55 long _nblocks;
56 int _count;
57 unsigned char _buf[64];
58 void transform(void *data);
59};
60
61#endif
KDOCTOOLS_EXPORT QString transform(const QString &file, const QString &stylesheet, const QList< const char * > &params=QList< const char * >())
KGuiItem reset()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:48:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.