2 Copyright (C) 2000-2007 MySQL AB
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; see the file COPYING. If not, write to the
15 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
19 /* ripemd.hpp provides RIPEMD digest support
22 #ifndef TAO_CRYPT_RIPEMD_HPP
23 #define TAO_CRYPT_RIPEMD_HPP
28 #if defined(TAOCRYPT_X86ASM_AVAILABLE) && defined(TAO_ASM)
36 class RIPEMD160
: public HASHwithTransform
{
38 enum { BLOCK_SIZE
= 64, DIGEST_SIZE
= 20, PAD_SIZE
= 56,
39 TAO_BYTE_ORDER
= LittleEndianOrder
}; // in Bytes
40 RIPEMD160() : HASHwithTransform(DIGEST_SIZE
/ sizeof(word32
), BLOCK_SIZE
)
42 ByteOrder
getByteOrder() const { return ByteOrder(TAO_BYTE_ORDER
); }
43 word32
getBlockSize() const { return BLOCK_SIZE
; }
44 word32
getDigestSize() const { return DIGEST_SIZE
; }
45 word32
getPadSize() const { return PAD_SIZE
; }
47 RIPEMD160(const RIPEMD160
&);
48 RIPEMD160
& operator= (const RIPEMD160
&);
51 void Update(const byte
*, word32
);
54 void Swap(RIPEMD160
&);
57 void AsmTransform(const byte
* data
, word32 times
);
60 inline void swap(RIPEMD160
& a
, RIPEMD160
& b
)
68 #endif // TAO_CRYPT_RIPEMD_HPP