1 /* This file is part of the KDE project
2 Copyright (C) 2001 George Staikos <staikos@kde.org>
3 Based heavily on SHA1 code from GPG 1.0.3 (C) 1998 FSF
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
25 #include <kwallet_export.h>
29 class KWALLETBACKEND_EXPORT SHA1
{
35 * The number of bits in the hash generated.
40 * True if all settings are good and we are ready to hash.
42 bool readyToGo() const;
45 * Process a block of data for the hash function.
47 int process(const void *block
, int len
);
50 * Return the digest as a 20 byte array reference.
51 * Calling this makes readyToGo() == false.
53 const unsigned char *hash();
56 * Reset the digest so a new one can be calculated.
64 long _h0
, _h1
, _h2
, _h3
, _h4
;
67 unsigned char _buf
[64];
68 void transform(void *data
);