00001 /* 00002 * ANSI X9.19 MAC 00003 * (C) 1999-2007 Jack Lloyd 00004 * 00005 * Distributed under the terms of the Botan license 00006 */ 00007 00008 #ifndef BOTAN_ANSI_X919_MAC_H__ 00009 #define BOTAN_ANSI_X919_MAC_H__ 00010 00011 #include <botan/mac.h> 00012 #include <botan/block_cipher.h> 00013 00014 namespace Botan { 00015 00016 /** 00017 * DES/3DES-based MAC from ANSI X9.19 00018 */ 00019 class BOTAN_DLL ANSI_X919_MAC : public MessageAuthenticationCode 00020 { 00021 public: 00022 void clear(); 00023 std::string name() const; 00024 MessageAuthenticationCode* clone() const; 00025 00026 /** 00027 * @param cipher the underlying block cipher to use 00028 */ 00029 ANSI_X919_MAC(BlockCipher* cipher); 00030 ~ANSI_X919_MAC(); 00031 private: 00032 void add_data(const byte[], u32bit); 00033 void final_result(byte[]); 00034 void key_schedule(const byte[], u32bit); 00035 00036 BlockCipher* e; 00037 BlockCipher* d; 00038 SecureVector<byte, 8> state; 00039 u32bit position; 00040 }; 00041 00042 } 00043 00044 #endif
1.5.8