Botan
1.11.15
|
00001 /* 00002 * HAS-160 00003 * (C) 1999-2007 Jack Lloyd 00004 * 00005 * Botan is released under the Simplified BSD License (see license.txt) 00006 */ 00007 00008 #ifndef BOTAN_HAS_160_H__ 00009 #define BOTAN_HAS_160_H__ 00010 00011 #include <botan/mdx_hash.h> 00012 00013 namespace Botan { 00014 00015 /** 00016 * HAS-160, a Korean hash function standardized in 00017 * TTAS.KO-12.0011/R1. Used in conjuction with KCDSA 00018 */ 00019 class BOTAN_DLL HAS_160 : public MDx_HashFunction 00020 { 00021 public: 00022 std::string name() const { return "HAS-160"; } 00023 size_t output_length() const { return 20; } 00024 HashFunction* clone() const { return new HAS_160; } 00025 00026 void clear(); 00027 00028 HAS_160() : MDx_HashFunction(64, false, true), X(20), digest(5) 00029 { clear(); } 00030 private: 00031 void compress_n(const byte[], size_t blocks); 00032 void copy_out(byte[]); 00033 00034 secure_vector<u32bit> X, digest; 00035 }; 00036 00037 } 00038 00039 #endif