ZeusBase-Library  2.0.4
MD5Hash.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch)
3  *****************************************************************************
4  * Project : Zeus Base Library
5  * Module : MD5Hash
6  * Package : Zeus.ZeusBase.Security
7  * Author : Benjamin Hadorn
8  * Date : 27.12.2011
9  * System : Zeus-Framework
10  *****************************************************************************
11  * Licence: *
12  * This library is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU Lesser General Public License as *
14  * published by the Free Software Foundation; either version *
15  * 2.1 of the License, or (at your option) any later version. *
16  * *
17  * This library is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU Lesser General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU Lesser General Public *
23  * License along with this library; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
25  *****************************************************************************/
26 
27 /*****************************************************************************
28  * Changes:
29  * 27.12.2011 bha: created zeus 2.0
30  *****************************************************************************/
31 
32 /* CODE INFORMATION:
33  The main code of this class has been taken from the "OpenSSL" Library.
34  Copyright information from OpenSSL:
35 */
36 /* ====================================================================
37  * Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
38  *
39  * Redistribution and use in source and binary forms, with or without
40  * modification, are permitted provided that the following conditions
41  * are met:
42  *
43  * 1. Redistributions of source code must retain the above copyright
44  * notice, this list of conditions and the following disclaimer.
45  *
46  * 2. Redistributions in binary form must reproduce the above copyright
47  * notice, this list of conditions and the following disclaimer in
48  * the documentation and/or other materials provided with the
49  * distribution.
50  *
51  * 3. All advertising materials mentioning features or use of this
52  * software must display the following acknowledgment:
53  * "This product includes software developed by the OpenSSL Project
54  * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
55  *
56  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
57  * endorse or promote products derived from this software without
58  * prior written permission. For written permission, please contact
59  * licensing@OpenSSL.org.
60  *
61  * 5. Products derived from this software may not be called "OpenSSL"
62  * nor may "OpenSSL" appear in their names without prior written
63  * permission of the OpenSSL Project.
64  *
65  * 6. Redistributions of any form whatsoever must retain the following
66  * acknowledgment:
67  * "This product includes software developed by the OpenSSL Project
68  * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
69  *
70  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
71  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
72  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
73  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
74  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
75  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
76  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
77  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
78  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
79  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
80  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
81  * OF THE POSSIBILITY OF SUCH DAMAGE.
82  * ====================================================================
83  *
84  */
85 
86 #ifndef MD5HashH
87 #define MD5HashH
88 
90 
91 #define MD5_CBLOCK 64
92 #define MD5_LBLOCK (MD5_CBLOCK/4)
93 
95 
96 class IString;
97 class ISerializable;
98 
99 /*****************************************************************************/
103 /*****************************************************************************/
105 {
106  public:
107  inline TMD5Hash() {}
108 
109  protected:
110 
111  //Methods of TAbstractMDHash
112  virtual Int getBlockSize() const;
113  virtual void initCTX(TypeMD_CTX& rCTX);
114  virtual void processBlock(TypeMD_CTX& rCtx, const Uint8* pucBuffer, Int iBlockNum);
115 
116  private:
117 
118 };
119 
120 /*****************************************************************************/
123 /*****************************************************************************/
124 inline Int TMD5Hash::getBlockSize() const
125 {
126  return MD5_CBLOCK;
127 }
128 
130 
131 #endif
#define END_NAMESPACE_Zeus
Definition: PlatformDefines.hpp:96
#define zeusbase_class
Definition: PlatformDefines.hpp:165
#define MD5_CBLOCK
Definition: MD5Hash.h:91
#define BEGIN_NAMESPACE_Zeus
Definition: PlatformDefines.hpp:95
TMD5Hash()
Definition: MD5Hash.h:107
Definition: MD5Hash.h:104
Definition: AbstractMDHash.h:98
unsigned char Uint8
Definition: PlatformDefines.hpp:212
Definition: AbstractMDHash.h:115


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Tue Sep 13 2016 22:30:45