delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kwalletd / backend / sha1.h
blob6ea22c5e2aa2c313625018c45d89f0a3ccd72415
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.
22 #ifndef __sha1__ko__h
23 #define __sha1__ko__h
25 #include <kwallet_export.h>
27 /* @internal
29 class KWALLETBACKEND_EXPORT SHA1 {
30 public:
31 SHA1();
32 ~SHA1();
35 * The number of bits in the hash generated.
37 int size() const;
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.
58 int reset();
60 protected:
61 int _hashlen;
62 bool _init;
64 long _h0, _h1, _h2, _h3, _h4;
65 long _nblocks;
66 int _count;
67 unsigned char _buf[64];
68 void transform(void *data);
72 #endif