2 // This file is part of the aMule Project.
4 // Copyright (c) 2003-2008 Angel Vidal (Kry) ( kry@amule.org )
5 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 // Kry - Modified version of the original SHA.cpp to work on linux and
26 // use wxWidgets. Original license follows.
30 ---------------------------------------------------------------------------
31 Copyright (c) 2002, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
36 The free distribution and use of this software in both source and binary
37 form is allowed (with or without changes) provided that:
39 1. distributions of this source code include the above copyright
40 notice, this list of conditions and the following disclaimer;
42 2. distributions in binary form include the above copyright
43 notice, this list of conditions and the following disclaimer
44 in the documentation and/or other associated materials;
46 3. the copyright holder's name is not used to endorse products
47 built using this software without specific written permission.
49 ALTERNATIVELY, provided that this notice is retained in full, this product
50 may be distributed under the terms of the GNU General Public License (GPL),
51 in which case the provisions of the GPL apply INSTEAD OF those given above.
55 This software is provided 'as is' with no explicit or implied warranties
56 in respect of its properties, including, but not limited to, correctness
57 and/or fitness for purpose.
58 ---------------------------------------------------------------------------
59 Issue Date: 30/11/2002
61 This is a byte oriented version of SHA1 that operates on arrays of bytes
62 stored in memory. It runs at 22 cycles per byte on a Pentium P4 processor
68 #include "SHAHashSet.h"
70 class CSHA
: public CAICHHashAlgo
79 virtual void Add(const void* pData
, uint32 nLength
);
80 virtual void Finish(CAICHHash
& Hash
);
81 virtual void GetHash(CAICHHash
& Hash
);
90 #define SHA1_BLOCK_SIZE 64
91 #define SHA1_DIGEST_SIZE 20
94 // File_checked_for_headers