Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# md2.h

    00001 #ifndef CRYPTOPP_MD2_H
    00002 #define CRYPTOPP_MD2_H
    00003
    00004 #include "cryptlib.h"
    00005 #include "secblock.h"
    00006
    00007 NAMESPACE_BEGIN(CryptoPP)
    00008
    00009 /// <a href="http://www.weidai.com/scan-mirror/md.html#MD2">MD2</a>
    00010 /** 128 Bit Hash */
    00011 class MD2 : public HashTransformation
    00012 {
    00013 public:
    00014         MD2();
    00015         void Update(const byte *input, unsigned int length);
    00016         void TruncatedFinal(byte *hash, unsigned int size);
    00017         unsigned int DigestSize() const {return DIGESTSIZE;}
    00018         static const char * StaticAlgorithmName() {return "MD2";}
    00019
    00020         enum {DIGESTSIZE = 16, BLOCKSIZE = 16};
    00021
    00022 private:
    00023         void Transform();
    00024         void Init();
    00025         SecByteBlock m_X, m_C, m_buf;
    00026         unsigned int m_count;
    00027 };
    00028
    00029 NAMESPACE_END
    00030
    00031 #endif