aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-06-06 19:57:46 +0000
committerlloyd <[email protected]>2009-06-06 19:57:46 +0000
commit95033a027fcda13453010805880ad7450d3ac3ff (patch)
tree4233c904bcc712e0af61ce75353163ad657a836a /src
parenta96eae0b3394b64aea544f9f0ce4664d3b4a5c58 (diff)
Mark Skein_512 with the BOTAN_DLL macro
Add a comment that the limitation of the personalization string being a maximum of 64 characters is due to the implementation and not the specification (but it makes it easy to implement, and in this particular case 64 characters is probably fine). Add some tests for the personalization option, generated by the Skein reference implementation. Disable stripping whitespace in checks/misc.cpp:strip - it strips the personalization tag, which breaks the test, and isn't needed otherwise because the test files are well-formed.
Diffstat (limited to 'src')
-rw-r--r--src/hash/skein/skein_512.cpp6
-rw-r--r--src/hash/skein/skein_512.h6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/hash/skein/skein_512.cpp b/src/hash/skein/skein_512.cpp
index c8a26ae82..eaef641ed 100644
--- a/src/hash/skein/skein_512.cpp
+++ b/src/hash/skein/skein_512.cpp
@@ -132,6 +132,7 @@ void initial_block(u64bit H[9], u64bit T[3], u32bit output_bits,
{
clear_mem(H, 9);
+ // ASCII("SHA3") followed by version (0x0001) code
byte config_str[32] = { 0x53, 0x48, 0x41, 0x33, 0x01, 0x00, 0 };
store_le(output_bits, config_str + 8);
@@ -140,6 +141,11 @@ void initial_block(u64bit H[9], u64bit T[3], u32bit output_bits,
if(personalization != "")
{
+ /*
+ This is a limitation of this implementation, and not of the
+ algorithm specification. Could be fixed relatively easily, but
+ doesn't seem worth the trouble.
+ */
if(personalization.length() > 64)
throw Invalid_Argument("Skein personalization must be <= 64 bytes");
diff --git a/src/hash/skein/skein_512.h b/src/hash/skein/skein_512.h
index 2192767ca..fa558fc0d 100644
--- a/src/hash/skein/skein_512.h
+++ b/src/hash/skein/skein_512.h
@@ -5,8 +5,8 @@
* Distributed under the terms of the Botan license
*/
-#ifndef BOTAN_SKEIN_H__
-#define BOTAN_SKEIN_H__
+#ifndef BOTAN_SKEIN_512_H__
+#define BOTAN_SKEIN_512_H__
#include <botan/secmem.h>
#include <botan/hash.h>
@@ -14,7 +14,7 @@
namespace Botan {
-class Skein_512 : public HashFunction
+class BOTAN_DLL Skein_512 : public HashFunction
{
public:
Skein_512(u32bit output_bits = 512,