libmoost
/home/mhx/git/github/libmoost/include/moost/digest/sha2.h
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00028 #ifndef MOOST_DIGEST_SHA2_H__
00029 #define MOOST_DIGEST_SHA2_H__
00030 
00031 #include <boost/shared_ptr.hpp>
00032 
00033 #include "base.h"
00034 
00035 #define SHA2_CLASS_DECL_(bits)                               \
00036    class sha ## bits ## _impl;                               \
00037                                                              \
00038    class sha ## bits : public base                           \
00039    {                                                         \
00040    public:                                                   \
00041       sha ## bits();                                         \
00042       virtual void reset();                                  \
00043       virtual void add_raw(const void *data, size_t size);   \
00044       virtual std::string digest() const;                    \
00045                                                              \
00046    private:                                                  \
00047       boost::shared_ptr<sha ## bits ## _impl> m_impl;        \
00048    }
00049 
00050 namespace moost { namespace digest {
00051 
00052 SHA2_CLASS_DECL_(224);
00053 SHA2_CLASS_DECL_(256);
00054 SHA2_CLASS_DECL_(384);
00055 SHA2_CLASS_DECL_(512);
00056 
00057 }}
00058 
00059 #undef SHA2_CLASS_DECL_
00060 
00061 #endif