aboutsummaryrefslogtreecommitdiff
path: root/paludis/util/whirlpool.hh
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2011-10-11 22:37:18 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2011-10-14 23:04:29 +0100
commit7c26476a765af03fdad2c6e5e9de49bbb0438520 (patch)
tree56a77223b2a84af1799465ddbf5970f4c2d3d01c /paludis/util/whirlpool.hh
parente394de7237dd35cb45471d324ff52a3ae190e4f9 (diff)
downloadpaludis-7c26476a765af03fdad2c6e5e9de49bbb0438520.tar.gz
paludis-7c26476a765af03fdad2c6e5e9de49bbb0438520.tar.xz
Add a Whirlpool implementation
Diffstat (limited to 'paludis/util/whirlpool.hh')
-rw-r--r--paludis/util/whirlpool.hh66
1 files changed, 66 insertions, 0 deletions
diff --git a/paludis/util/whirlpool.hh b/paludis/util/whirlpool.hh
new file mode 100644
index 000000000..cf9be601b
--- /dev/null
+++ b/paludis/util/whirlpool.hh
@@ -0,0 +1,66 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2008, 2011 David Leverton
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_UTIL_WHIRLPOOL_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_WHIRLPOOL_HH 1
+
+#include <iosfwd>
+#include <string>
+#include <paludis/util/attributes.hh>
+#include <inttypes.h>
+
+/** \file
+ * Declarations for the Whirlpool digest class.
+ *
+ * \ingroup g_digests
+ *
+ * \section Examples
+ *
+ * - None at this time.
+ */
+
+namespace paludis
+{
+ /**
+ * Whirlpool digest class.
+ *
+ * \ingroup g_digests
+ */
+ class PALUDIS_VISIBLE Whirlpool
+ {
+ private:
+ uint64_t H[8];
+
+ void PALUDIS_HIDDEN process_block(const uint64_t *);
+
+ public:
+ /**
+ * Constructor.
+ */
+ Whirlpool(std::istream & stream);
+
+ /**
+ * Our checksum, as a string of hex characters.
+ */
+ std::string hexsum() const;
+ };
+}
+
+#endif